Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
5d8771d1
Unverified
Commit
5d8771d1
authored
Aug 11, 2018
by
Todd Volkert
Committed by
GitHub
Aug 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update fuchsia_tester to work in (and require) Dart 2 mode (#20460)
parent
a737c86a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
15 deletions
+31
-15
fuchsia_tester.dart
packages/flutter_tools/bin/fuchsia_tester.dart
+29
-15
runner.dart
packages/flutter_tools/lib/src/test/runner.dart
+2
-0
No files found.
packages/flutter_tools/bin/fuchsia_tester.dart
View file @
5d8771d1
...
...
@@ -24,10 +24,16 @@ import 'package:flutter_tools/src/usage.dart';
const
String
_kOptionPackages
=
'packages'
;
const
String
_kOptionShell
=
'shell'
;
const
String
_kOptionTestDirectory
=
'test-directory'
;
const
String
_kOptionSdkRoot
=
'sdk-root'
;
const
String
_kOptionTestFile
=
'test-file'
;
const
String
_kOptionDillFile
=
'dill-file'
;
const
List
<
String
>
_kRequiredOptions
=
<
String
>[
_kOptionPackages
,
_kOptionShell
,
_kOptionTestDirectory
,
_kOptionSdkRoot
,
_kOptionTestFile
,
_kOptionDillFile
,
];
const
String
_kOptionCoverage
=
'coverage'
;
const
String
_kOptionCoveragePath
=
'coverage-path'
;
...
...
@@ -38,20 +44,14 @@ void main(List<String> args) {
});
}
List
<
String
>
_findTests
(
Directory
directory
)
{
return
directory
.
listSync
(
recursive:
true
,
followLinks:
false
)
.
where
((
FileSystemEntity
entity
)
=>
entity
.
path
.
endsWith
(
'_test.dart'
)
&&
fs
.
isFileSync
(
entity
.
path
))
.
map
((
FileSystemEntity
entity
)
=>
fs
.
path
.
absolute
(
entity
.
path
))
.
toList
();
}
Future
<
Null
>
run
(
List
<
String
>
args
)
async
{
final
ArgParser
parser
=
new
ArgParser
()
..
addOption
(
_kOptionPackages
,
help:
'The .packages file'
)
..
addOption
(
_kOptionShell
,
help:
'The Flutter shell binary'
)
..
addOption
(
_kOptionTestDirectory
,
help:
'Directory containing the tests'
)
..
addOption
(
_kOptionSdkRoot
,
help:
'Path to the SDK platform files'
)
..
addOption
(
_kOptionTestFile
,
help:
'Test file to execute'
)
..
addOption
(
_kOptionDillFile
,
help:
'Precompiled dill file for test'
)
..
addFlag
(
_kOptionCoverage
,
defaultsTo:
false
,
negatable:
false
,
...
...
@@ -72,22 +72,33 @@ Future<Null> run(List<String> args) async {
Cache
.
flutterRoot
=
tempDirectory
.
path
;
final
Directory
testDirectory
=
fs
.
directory
(
argResults
[
_kOptionTestDirectory
]);
final
List
<
String
>
tests
=
_findTests
(
testDirectory
);
final
List
<
String
>
testArgs
=
<
String
>[];
testArgs
.
add
(
'--'
);
testArgs
.
addAll
(
tests
);
final
File
testFile
=
fs
.
file
(
argResults
[
_kOptionTestFile
]);
final
File
dillFile
=
fs
.
file
(
argResults
[
_kOptionDillFile
]);
final
String
shellPath
=
argResults
[
_kOptionShell
];
if
(!
fs
.
isFileSync
(
shellPath
))
{
throwToolExit
(
'Cannot find Flutter shell at
$shellPath
'
);
}
final
Directory
sdkRootSrc
=
fs
.
directory
(
argResults
[
_kOptionSdkRoot
]);
if
(!
fs
.
isDirectorySync
(
sdkRootSrc
.
path
))
{
throwToolExit
(
'Cannot find SDK files at
${sdkRootSrc.path}
'
);
}
// Put the tester shell where runTests expects it.
// TODO(tvolkert,garymm): Switch to a Fuchsia-specific Artifacts impl.
final
Link
testerDestLink
=
fs
.
link
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterTester
));
testerDestLink
.
parent
.
createSync
(
recursive:
true
);
testerDestLink
.
createSync
(
shellPath
);
final
Directory
sdkRootDest
=
fs
.
directory
(
artifacts
.
getArtifactPath
(
Artifact
.
flutterPatchedSdkPath
));
sdkRootDest
.
createSync
(
recursive:
true
);
for
(
FileSystemEntity
artifact
in
sdkRootSrc
.
listSync
())
{
fs
.
link
(
sdkRootDest
.
childFile
(
artifact
.
basename
).
path
).
createSync
(
artifact
.
path
);
}
// TODO(tvolkert): Remove once flutter_tester no longer looks for this.
fs
.
link
(
sdkRootDest
.
childFile
(
'platform.dill'
).
path
).
createSync
(
'platform_strong.dill'
);
PackageMap
.
globalPackagesPath
=
fs
.
path
.
normalize
(
fs
.
path
.
absolute
(
argResults
[
_kOptionPackages
]));
...
...
@@ -98,10 +109,13 @@ Future<Null> run(List<String> args) async {
}
exitCode
=
await
runTests
(
tests
,
<
String
>[
testFile
.
path
]
,
workDir:
testDirectory
,
watcher:
collector
,
ipv6:
false
,
enableObservatory:
collector
!=
null
,
previewDart2:
true
,
precompiledDillPath:
dillFile
.
path
,
);
if
(
collector
!=
null
)
{
...
...
packages/flutter_tools/lib/src/test/runner.dart
View file @
5d8771d1
...
...
@@ -30,6 +30,7 @@ Future<int> runTests(
bool
ipv6
=
false
,
bool
machine
=
false
,
bool
previewDart2
=
false
,
String
precompiledDillPath
,
bool
trackWidgetCreation
=
false
,
bool
updateGoldens
=
false
,
TestWatcher
watcher
,
...
...
@@ -88,6 +89,7 @@ Future<int> runTests(
startPaused:
startPaused
,
serverType:
serverType
,
previewDart2:
previewDart2
,
precompiledDillPath:
precompiledDillPath
,
trackWidgetCreation:
trackWidgetCreation
,
updateGoldens:
updateGoldens
,
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment