Chromium Code Reviews| Index: tools/testing/dart/test_options.dart |
| diff --git a/tools/testing/dart/test_options.dart b/tools/testing/dart/test_options.dart |
| index 255564ac5c1688a84428a97b19f7fa2333f0428a..e3146b6c1407e3fbb48198cb3e9865bb30843768 100644 |
| --- a/tools/testing/dart/test_options.dart |
| +++ b/tools/testing/dart/test_options.dart |
| @@ -26,6 +26,7 @@ const List<String> defaultTestSelectors = const [ |
| 'pkg', |
| 'analyze_library', |
| 'service', |
| + 'kernel', |
| 'observatory_ui' |
| ]; |
| @@ -77,7 +78,8 @@ class TestOptionsParser { |
| dart2appjit: Compile the Dart code into an app snapshot before running test |
| (only valid with dart_app runtime)''', |
|
Bill Hesse
2016/10/21 12:17:39
Can we expand this comment with the new compilers?
Vyacheslav Egorov (Google)
2016/10/21 13:39:44
Done.
|
| ['-c', '--compiler'], |
| - ['none', 'precompiler', 'dart2js', 'dart2analyzer', 'dart2app', 'dart2appjit'], |
| + ['none', 'precompiler', 'dart2js', 'dart2analyzer', 'dart2app', |
| + 'dart2appjit', 'dartk', 'dartkp', 'ir2ir'], |
| 'none'), |
| // TODO(antonm): fix the option drt. |
| new _TestOptionSpecification( |
| @@ -156,6 +158,16 @@ class TestOptionsParser { |
| ], |
| 'x64'), |
| new _TestOptionSpecification( |
| + 'kernel_transformers', |
| + 'The kernel transformations to apply in order (separated by comma). ' |
| + 'A transformer can either be just a "name" (in which case it must be ' |
| + 'available in kernel/bin/tansform.dart) or a "name:path" pair ' |
| + '(in which case "path" must point to an executable script which takes' |
| + ' `input-file` and `output-file` as arguments).', |
| + ['--kernel_transformers'], |
| + [], |
| + ''), |
| + new _TestOptionSpecification( |
| 'system', |
| 'The operating system to run tests on', |
| ['-s', '--system'], |
| @@ -674,9 +686,18 @@ Note: currently only implemented for dart2js.''', |
| case 'dart2appjit': |
| validRuntimes = const ['dart_app']; |
| break; |
| + case 'ir2ir': |
| + validRuntimes = const ['vm']; |
| + break; |
| case 'precompiler': |
| validRuntimes = const ['dart_precompiled']; |
| break; |
| + case 'dartk': |
| + validRuntimes = const ['vm']; |
| + break; |
| + case 'dartkp': |
| + validRuntimes = const ['dart_precompiled']; |
| + break; |
| case 'none': |
| validRuntimes = const [ |
| 'vm', |
| @@ -687,6 +708,13 @@ Note: currently only implemented for dart2js.''', |
| ]; |
| break; |
| } |
| + var kernelCompilers = const ['dartk', 'dartkp', 'ir2ir']; |
| + if (config['kernel_transformers']?.length > 0 && |
| + !kernelCompilers.contains(config['compiler'])) { |
| + isValid = false; |
| + print("Warning: The `--kernel_transformers` option can only be used in " |
| + "combination with the ${kernelCompilers.join(', ')} compilers."); |
| + } |
| if (!validRuntimes.contains(config['runtime'])) { |
| isValid = false; |
| print("Warning: combination of compiler '${config['compiler']}' and " |
| @@ -868,6 +896,11 @@ Note: currently only implemented for dart2js.''', |
| } |
| } |
| + if (configuration['compiler'] == 'ir2ir' && |
| + configuration['kernel_transformers'] == '') { |
| + throw "Cannot use --compiler=ir2ir without --kernel_transformers=...!"; |
| + } |
| + |
| // Adjust default timeout based on mode, compiler, and sometimes runtime. |
| if (configuration['timeout'] == -1) { |
| var isReload = configuration['hot_reload'] || |