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
d2c6b0a6
Commit
d2c6b0a6
authored
Apr 27, 2017
by
P.Y. Laligand
Committed by
GitHub
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of unnecessary flutter_root argument. (#9622)
parent
23b8e1f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
26 deletions
+25
-26
fuchsia_tester.dart
packages/flutter_tools/bin/fuchsia_tester.dart
+25
-26
No files found.
packages/flutter_tools/bin/fuchsia_tester.dart
View file @
d2c6b0a6
...
...
@@ -28,12 +28,10 @@ import '../lib/src/usage.dart';
const
String
_kOptionPackages
=
"packages"
;
const
String
_kOptionShell
=
"shell"
;
const
String
_kOptionTestDirectory
=
"test-directory"
;
const
String
_kOptionFlutterRoot
=
"flutter-root"
;
const
List
<
String
>
_kRequiredOptions
=
const
<
String
>[
_kOptionPackages
,
_kOptionShell
,
_kOptionTestDirectory
,
_kOptionFlutterRoot
,
];
Future
<
Null
>
main
(
List
<
String
>
args
)
async
{
...
...
@@ -65,40 +63,41 @@ 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
(
_kOptionFlutterRoot
,
help:
'Flutter root'
);
..
addOption
(
_kOptionTestDirectory
,
help:
'Directory containing the tests'
);
final
ArgResults
argResults
=
parser
.
parse
(
args
);
if
(
_kRequiredOptions
.
any
((
String
option
)
=>
!
argResults
.
options
.
contains
(
option
)))
{
printError
(
'Missing option! All options must be specified.'
);
exit
(
1
);
}
// TODO(pylaligand): use a temp directory instead.
Cache
.
flutterRoot
=
argResults
[
_kOptionFlutterRoot
];
final
Directory
testDirectory
=
fs
.
directory
(
argResults
[
_kOptionTestDirectory
]);
final
Iterable
<
String
>
tests
=
_findTests
(
testDirectory
);
final
Directory
tempDirectory
=
fs
.
systemTempDirectory
.
createTempSync
(
'fuchsia_tester'
);
try
{
Cache
.
flutterRoot
=
tempDirectory
.
path
;
final
Directory
testDirectory
=
fs
.
directory
(
argResults
[
_kOptionTestDirectory
]);
final
Iterable
<
String
>
tests
=
_findTests
(
testDirectory
);
final
List
<
String
>
testArgs
=
<
String
>[];
testArgs
.
add
(
'--'
);
testArgs
.
addAll
(
tests
);
final
List
<
String
>
testArgs
=
<
String
>[];
testArgs
.
add
(
'--'
);
testArgs
.
addAll
(
tests
);
final
String
shellPath
=
argResults
[
_kOptionShell
];
if
(!
fs
.
isFileSync
(
shellPath
))
{
throwToolExit
(
'Cannot find Flutter shell at
$shellPath
'
);
}
loader
.
installHook
(
shellPath:
shellPath
,
debuggerMode:
false
,
);
PackageMap
.
globalPackagesPath
=
fs
.
path
.
normalize
(
fs
.
path
.
absolute
(
argResults
[
_kOptionPackages
]));
fs
.
currentDirectory
=
testDirectory
;
final
String
shellPath
=
argResults
[
_kOptionShell
];
if
(!
fs
.
isFileSync
(
shellPath
))
{
throwToolExit
(
'Cannot find Flutter shell at
$shellPath
'
);
}
loader
.
installHook
(
shellPath:
shellPath
,
debuggerMode:
false
,
);
await
test
.
main
(
testArgs
);
PackageMap
.
globalPackagesPath
=
fs
.
path
.
normalize
(
fs
.
path
.
absolute
(
argResults
[
_kOptionPackages
]));
fs
.
currentDirectory
=
testDirectory
;
if
(
exitCode
!=
0
)
{
await
test
.
main
(
testArgs
);
exit
(
exitCode
);
}
finally
{
tempDirectory
.
deleteSync
(
recursive:
true
);
}
}
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