Chromium Code Reviews| Index: tools/testing/dart/test_options.dart |
| =================================================================== |
| --- tools/testing/dart/test_options.dart (revision 5794) |
| +++ tools/testing/dart/test_options.dart (working copy) |
| @@ -62,42 +62,44 @@ |
| ['all', 'debug', 'release'], |
| 'debug'), |
| new _TestOptionSpecification( |
| - 'component', |
| - ''' |
| -Controls how dart code is compiled and executed. |
| + 'compiler', |
| + '''Specify any compilation step (if needed). |
| - vm: Run dart code on the standalone dart vm. |
| + none: Do not compile the Dart code (run native Dart code on the VM). |
|
ahe
2012/03/24 13:56:40
I don't think compiler 'none' should imply running
Emily Fortuna
2012/03/26 20:52:32
In what case when the compiler=none would we not b
ahe
2012/04/13 13:46:20
Dartium for example.
I'm just saying that, compil
Emily Fortuna
2012/04/13 17:45:56
True. This was Ivan's request to make running on t
|
| - frog: Compile dart code by running frog on the standalone dart vm, and |
| - run the resulting javascript on D8. |
| + frog: Compile dart code to JavaScript by running the frog compiler. |
| - dart2js: Compile dart code by running dart2js on the standalone |
| - dart vm, and run the resulting javascript on D8. |
| + dart2js: Compile dart code to JavaScript by running dart2js (leg). |
| - frogsh: Compile dart code by running frog on node.js, and run the |
| - resulting javascript on the same instance of node.js. |
| - |
| - dartium: Run dart code in a type="application/dart" script tag in a |
| - dartium build of DumpRenderTree. |
| - |
| - frogium: Compile dart code by running frog on the standalone dart vm, |
| - and run the resulting javascript in a javascript script tag in |
| - a dartium build of DumpRenderTree. |
| - |
| - legium: Compile dart code by running dart2js on the standalone dart |
| - vm, and run the resulting javascript in a javascript script tag |
| - in a dartium build of DumpRenderTree. |
| - |
| - webdriver: Compile dart code by running frog on the standalone dart vm, |
| - and then run the resulting javascript in the browser that is specified |
| - by the --browser switch (e.g. chrome, safari, ff, etc.). |
| - |
| - dartc: Run dart code through the dartc static analyzer (does not |
| - execute dart code). |
| + dartc: Perform static analysis on Dart code by running dartc. |
| ''', |
| - ['-c', '--component'], |
| - ['most', 'vm', 'frog', 'dart2js', 'frogsh', 'dartium', 'frogium', |
| - 'legium', 'webdriver', 'dartc'], |
| + ['-c', '--compiler'], |
| + ['none', 'frog', 'dart2js', 'dartc'], |
|
Siggi Cherem (dart-lang)
2012/03/23 23:57:33
seems like you still need frogsh? (saw it in statu
ahe
2012/03/24 13:56:40
I don't think we run frogsh anymore on build bots.
Emily Fortuna
2012/03/26 20:52:32
@Peter, SGTM. In this CL I had originally removed
|
| + 'none'), |
| + new _TestOptionSpecification( |
| + 'runtime', |
| + '''Where the tests should be run. |
| + vm: Run Dart code on the standalone dart vm. |
| + |
| + d8: Run JavaScript from the command line using v8. |
| + |
| + drt: Run Dart or JavaScript in the headless version of Chrome, |
| + DumpRenderTree. |
| + |
| + ff or firefox: Run JavaScript in Firefox. |
| + |
| + chrome: Run JavaScript in Chrome. |
| + |
| + safari: Run JavaScript in Safari. |
| + |
| + ie: Run JavaScript in Internet Explorer. |
| + |
| + opera: Run JavaScript in Opera. |
| + |
| + none: No runtime (used for dartc static analysis tests).''', |
|
ahe
2012/03/24 13:56:40
for example.
Emily Fortuna
2012/03/26 20:52:32
Done.
|
| + ['-r', '--runtime'], |
| + ['vm', 'd8', 'drt', 'ff', 'firefox', 'chrome', |
| + 'safari', 'ie', 'opera', 'none'], |
| 'vm'), |
| new _TestOptionSpecification( |
| 'arch', |
| @@ -202,30 +204,12 @@ |
| false, |
| 'bool'), |
| new _TestOptionSpecification( |
| - 'browser', |
| - 'Web browser to use on webdriver tests', |
| - ['-b', '--browser'], |
| - ['ff', 'chrome', 'safari', 'ie', 'opera'], |
| - 'chrome'), |
| - new _TestOptionSpecification( |
| - 'frog', |
| - 'Path to frog executable', |
| - ['--frog'], |
| - [], |
| - ''), |
| - new _TestOptionSpecification( |
| 'drt', |
| 'Path to DumpRenderTree executable', |
| ['--drt'], |
| [], |
| ''), |
| new _TestOptionSpecification( |
| - 'froglib', |
| - 'Path to frog library', |
| - ['--froglib'], |
| - [], |
| - ''), |
| - new _TestOptionSpecification( |
| 'noBatch', |
| 'Do not run browser tests in batch mode', |
| ['-n', '--nobatch'], |
| @@ -365,9 +349,6 @@ |
| if (configuration['mode'] == 'all') { |
| configuration['mode'] = 'debug,release'; |
| } |
| - if (configuration['component'] == 'most') { |
| - configuration['component'] = 'vm,dartc'; |
| - } |
| if (configuration['valgrind']) { |
| // TODO(ager): Get rid of this when there is only one checkout and |
| // we don't have to special case for the runtime checkout. |
| @@ -390,6 +371,10 @@ |
| configuration['unchecked'] = !configuration['checked']; |
| configuration['host_unchecked'] = !configuration['host_checked']; |
| + if (configuration['runtime'] == 'firefox') { |
| + configuration['runtime'] == 'ff'; |
| + } |
| + |
| // Expand the test selectors into a suite name and a simple |
| // regular expressions to be used on the full path of a test file |
| // in that test suite. If no selectors are explicitly given use |
| @@ -423,59 +408,45 @@ |
| } |
| // Expand the architectures. |
| - var archs = configuration['arch']; |
| - if (archs.contains(',')) { |
| - var result = new List<Map>(); |
| - for (var arch in archs.split(',')) { |
| - var newConfiguration = new Map.from(configuration); |
| - newConfiguration['arch'] = arch; |
| - result.addAll(_expandConfigurations(newConfiguration)); |
| - } |
| - return result; |
| + if (configuration['arch'].contains(',')) { |
| + return _expandHelper('arch', configuration); |
| } |
| // Expand modes. |
| - var modes = configuration['mode']; |
| - if (modes.contains(',')) { |
| - var result = new List<Map>(); |
| - for (var mode in modes.split(',')) { |
| - var newConfiguration = new Map.from(configuration); |
| - newConfiguration['mode'] = mode; |
| - result.addAll(_expandConfigurations(newConfiguration)); |
| - } |
| - return result; |
| + if (configuration['mode'].contains(',')) { |
| + return _expandHelper('mode', configuration); |
| } |
| + |
| + // Expand compilers. |
| + if (configuration['compiler'].contains(',')) { |
| + return _expandHelper('compiler', configuration); |
| + } |
| - // Expand components. |
| - var components = configuration['component']; |
| - if (components.contains(',')) { |
| - var result = new List<Map>(); |
| - for (var component in components.split(',')) { |
| - var newConfiguration = new Map.from(configuration); |
| - newConfiguration['component'] = component; |
| - result.addAll(_expandConfigurations(newConfiguration)); |
| - } |
| - return result; |
| + // Expand runtimes. |
| + var runtimes = configuration['runtime']; |
| + if (runtimes.contains(',')) { |
| + return _expandHelper('runtime', configuration); |
|
Siggi Cherem (dart-lang)
2012/03/23 23:57:33
could we add a function (or a TODO) that checks th
Emily Fortuna
2012/03/26 20:52:32
Done.
Siggi Cherem (dart-lang)
2012/03/26 22:28:39
Nice, thanks!
|
| } else { |
| - // All components eventually go through this path, after expansion. |
| - if (DumpRenderTreeUpdater.componentRequiresDRT(components)) { |
| + // All runtimes eventually go through this path, after expansion. |
| + if (runtimes == 'drt') { |
| DumpRenderTreeUpdater.update(); |
| } |
| } |
| - // Adjust default timeout based on mode and component. |
| + // Adjust default timeout based on mode and runtime. |
| if (configuration['timeout'] == -1) { |
| var timeout = 60; |
| - switch (configuration['component']) { |
| - case 'dartc': |
| - case 'dartium': |
| - case 'frogium': |
| - case 'legium': |
| - case 'webdriver': |
| + switch (configuration['runtime']) { |
| + case 'none': // none = dartc static analysis |
|
ahe
2012/03/24 13:56:40
I would prefer that none does not imply dartc.
Emily Fortuna
2012/03/26 20:52:32
Done.
|
| + case 'drt': |
| + case 'ie': |
| + case 'ff': |
| + case 'chrome': |
| + case 'safari': |
| + case 'opera': |
| timeout *= 4; |
| break; |
| - case 'dart2js': |
| - case 'frog': |
| + case 'd8': |
|
ahe
2012/03/24 13:56:40
It has nothing to do with d8, the problem is the c
Emily Fortuna
2012/03/26 20:52:32
Done.
|
| if (configuration['mode'] == 'debug') { |
| timeout *= 8; |
| } |
| @@ -495,7 +466,27 @@ |
| return [configuration]; |
| } |
| + /** |
| + * Helper for _expandConfigurations. Creates a new configuration and adds it |
| + * to a list, for use in a case when a particular configuration has multiple |
| + * results (separated by a ','. |
|
ahe
2012/03/24 13:56:40
Missing close parens.
Emily Fortuna
2012/03/26 20:52:32
Done.
|
| + * Arguments: |
| + * option: The particular test option we are expanding. |
| + * configuration: The map containing all test configuration information |
| + * specified. |
| + */ |
| + List<Map> _expandHelper(String option, Map configuration) { |
| + var result = new List<Map>(); |
| + var configs = configuration[option]; |
| + for (var config in configs.split(',')) { |
| + var newConfiguration = new Map.from(configuration); |
| + newConfiguration[option] = config; |
| + result.addAll(_expandConfigurations(newConfiguration)); |
| + } |
| + return result; |
| + } |
| + |
| /** |
| * Print out usage information. |
| */ |