@@ -22,21 +22,34 @@ void main(List<String> args) async {
2222 var tests = loadAllTests (suiteRoot);
2323 final parser = ArgParser ()
2424 ..addFlag ('help' , help: 'Help message' , negatable: false , abbr: 'h' )
25- ..addOption ('test' ,
26- help: 'Run a single test, rather than the entire suite' ,
27- allowed: tests.map ((t) => t.name).toList (),
28- abbr: 't' )
29- ..addOption ('runtime' ,
30- help: 'Which runtime to use to run the test configuration' ,
31- allowed: Target .values.map ((v) => v.name),
32- defaultsTo: Target .ddc.name,
33- abbr: 'r' )
34- ..addOption ('configuration' ,
35- help: 'Configuration to use for reporting test results' , abbr: 'n' )
36- ..addOption ('output-directory' ,
37- help: 'location where to emit the json-l result and log files' )
38- ..addFlag ('verbose' ,
39- help: 'Show a lot of information' , negatable: false , abbr: 'v' );
25+ ..addOption (
26+ 'test' ,
27+ help: 'Run a single test, rather than the entire suite' ,
28+ allowed: tests.map ((t) => t.name).toList (),
29+ abbr: 't' ,
30+ )
31+ ..addOption (
32+ 'runtime' ,
33+ help: 'Which runtime to use to run the test configuration' ,
34+ allowed: Target .values.map ((v) => v.name),
35+ defaultsTo: Target .ddc.name,
36+ abbr: 'r' ,
37+ )
38+ ..addOption (
39+ 'configuration' ,
40+ help: 'Configuration to use for reporting test results' ,
41+ abbr: 'n' ,
42+ )
43+ ..addOption (
44+ 'output-directory' ,
45+ help: 'location where to emit the json-l result and log files' ,
46+ )
47+ ..addFlag (
48+ 'verbose' ,
49+ help: 'Show a lot of information' ,
50+ negatable: false ,
51+ abbr: 'v' ,
52+ );
4053 final options = parser.parse (args);
4154 if (options['help' ] as bool ) {
4255 print (parser.usage);
@@ -68,10 +81,12 @@ void main(List<String> args) async {
6881 }
6982 results.add (testResult);
7083 }
71- final result = _reportResults (results,
72- writeLog: singleTest == null ,
73- configuration: options['configuration' ],
74- logDir: options['output-directory' ]);
84+ final result = _reportResults (
85+ results,
86+ writeLog: singleTest == null ,
87+ configuration: options['configuration' ],
88+ logDir: options['output-directory' ],
89+ );
7590 if (result != 0 ) {
7691 exitCode = result;
7792 }
@@ -83,7 +98,9 @@ void main(List<String> args) async {
8398/// Takes the steps to build the artifacts needed by a test and then execute it
8499/// on the target environment.
85100Future <DynamicModuleTestResult > _runSingleTest (
86- DynamicModuleTest test, TargetExecutor target) async {
101+ DynamicModuleTest test,
102+ TargetExecutor target,
103+ ) async {
87104 var timer = Stopwatch ()..start ();
88105 try {
89106 await target.compileApplication (test);
@@ -132,14 +149,16 @@ int _reportResults(
132149 // Ensure the directory URI ends with a path separator.
133150 var dirUri = Directory (logDir).uri;
134151 File .fromUri (dirUri.resolve ('results.json' )).writeAsStringSync (
135- results.map ((r) => '${r .toRecordJson (configuration )}\n ' ).join (),
136- flush: true );
152+ results.map ((r) => '${r .toRecordJson (configuration )}\n ' ).join (),
153+ flush: true ,
154+ );
137155 File .fromUri (dirUri.resolve ('logs.json' )).writeAsStringSync (
138- results
139- .where ((r) => r.status != Status .pass)
140- .map ((r) => '${r .toLogJson (configuration )}\n ' )
141- .join (),
142- flush: true );
156+ results
157+ .where ((r) => r.status != Status .pass)
158+ .map ((r) => '${r .toLogJson (configuration )}\n ' )
159+ .join (),
160+ flush: true ,
161+ );
143162
144163 print ('Success: log files emitted under $dirUri ' );
145164 } else if (fail) {
0 commit comments