OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * Tool for running co19 tests. Used when updating co19. | 6 * Tool for running co19 tests. Used when updating co19. |
7 * | 7 * |
8 * Currently, this tool is merely a convenience around multiple | 8 * Currently, this tool is merely a convenience around multiple |
9 * invocations of test.dart. Long term, we hope to evolve this into a | 9 * invocations of test.dart. Long term, we hope to evolve this into a |
10 * script that can automate most of the tasks necessary when updating | 10 * script that can automate most of the tasks necessary when updating |
11 * co19. | 11 * co19. |
12 * | 12 * |
13 * Usage: | 13 * Usage: |
14 * [: ./tools/testing/bin/$OS/dart tools/testing/dart/co19_test.dart :] | 14 * [: ./tools/testing/bin/$OS/dart tools/testing/dart/co19_test.dart :] |
15 */ | 15 */ |
16 | 16 |
17 library co19_test; | 17 library co19_test; |
18 | 18 |
19 import "dart:io"; | 19 import "dart:io"; |
20 | 20 |
21 import "test_options.dart"; | 21 import "test_options.dart"; |
22 import "test_suite.dart"; | 22 import "test_suite.dart"; |
23 import "utils.dart" show Path; | |
24 import "../../test.dart" as test_dart; | 23 import "../../test.dart" as test_dart; |
25 | 24 |
26 const List<String> COMMON_ARGUMENTS = | 25 const List<String> COMMON_ARGUMENTS = |
27 const <String>['--report', '--progress=diff', 'co19']; | 26 const <String>['--report', '--progress=diff', 'co19']; |
28 | 27 |
29 const List<List<String>> COMMAND_LINES = const <List<String>>[ | 28 const List<List<String>> COMMAND_LINES = const <List<String>>[ |
30 const <String>['-mrelease,debug', '-rvm', '-cnone'], | 29 const <String>['-mrelease,debug', '-rvm', '-cnone'], |
31 const <String>['-mrelease,debug', '-rvm', '-cnone', '--checked'], | 30 const <String>['-mrelease,debug', '-rvm', '-cnone', '--checked'], |
32 const <String>['-mrelease', '-rnone', '-cdartanalyzer'], | 31 const <String>['-mrelease', '-rnone', '-cdartanalyzer'], |
33 const <String>['-mrelease', '-rnone', '-cdart2analyzer'], | 32 const <String>['-mrelease', '-rnone', '-cdart2analyzer'], |
34 const <String>['-mrelease', '-rvm', '-cdart2dart', '--use-sdk'], | 33 const <String>['-mrelease', '-rvm', '-cdart2dart', '--use-sdk'], |
35 const <String>['-mrelease', '-rvm', '-cdart2dart', '--use-sdk', '--minified'
], | 34 const <String>['-mrelease', '-rvm', '-cdart2dart', '--use-sdk', '--minified'
], |
36 const <String>['-mrelease', '-rd8', '-cdart2js', '--use-sdk'], | 35 const <String>['-mrelease', '-rd8', '-cdart2js', '--use-sdk'], |
37 const <String>['-mrelease', '-rd8,jsshell', '-cdart2js', '--use-sdk', | 36 const <String>['-mrelease', '-rd8,jsshell', '-cdart2js', '--use-sdk', |
38 '--minified'], | 37 '--minified'], |
39 const <String>['-mrelease', '-rd8,jsshell', '-cdart2js', '--use-sdk', | 38 const <String>['-mrelease', '-rd8,jsshell', '-cdart2js', '--use-sdk', |
40 '--checked'], | 39 '--checked'], |
41 const <String>['-mrelease', '-rdartium', '-cnone', '--use-sdk', | 40 const <String>['-mrelease', '-rdartium', '-cnone', '--use-sdk', |
42 '--checked'], | 41 '--checked'], |
43 const <String>['-mrelease', '-rdartium', '-cnone', '--use-sdk'], | 42 const <String>['-mrelease', '-rdartium', '-cnone', '--use-sdk'], |
44 ]; | 43 ]; |
45 | 44 |
46 void main(List<String> args) { | 45 void main(List<String> args) { |
47 File scriptFile = new File(new Path(Platform.script.path).toNativePath()); | 46 TestUtils.setDartDirUri(Platform.script.resolve('../../..')); |
48 Path scriptPath = new Path(scriptFile.absolute.path) | |
49 .directoryPath.directoryPath.directoryPath.append('test.dart'); | |
50 TestUtils.testScriptPath = scriptPath.toNativePath(); | |
51 var optionsParser = new TestOptionsParser(); | 47 var optionsParser = new TestOptionsParser(); |
52 List<Map> configurations = <Map>[]; | 48 List<Map> configurations = <Map>[]; |
53 for (var commandLine in COMMAND_LINES) { | 49 for (var commandLine in COMMAND_LINES) { |
54 List arguments = <String>[]; | 50 List arguments = <String>[]; |
55 arguments.addAll(COMMON_ARGUMENTS); | 51 arguments.addAll(COMMON_ARGUMENTS); |
56 arguments.addAll(args); | 52 arguments.addAll(args); |
57 arguments.addAll(commandLine); | 53 arguments.addAll(commandLine); |
58 configurations.addAll(optionsParser.parse(arguments)); | 54 configurations.addAll(optionsParser.parse(arguments)); |
59 } | 55 } |
60 | 56 |
61 if (configurations != null || configurations.length > 0) { | 57 if (configurations != null || configurations.length > 0) { |
62 test_dart.testConfigurations(configurations); | 58 test_dart.testConfigurations(configurations); |
63 } | 59 } |
64 } | 60 } |
65 | 61 |
OLD | NEW |