Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: tools/testing/dart/test_options.dart

Issue 2549793002: Add 'self_check' runtime for running self-checking unit tests (Closed)
Patch Set: Address comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/testing/dart/runtime_configuration.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library test_options_parser; 5 library test_options_parser;
6 6
7 import "dart:io"; 7 import "dart:io";
8 import "drt_updater.dart"; 8 import "drt_updater.dart";
9 import "test_suite.dart"; 9 import "test_suite.dart";
10 import "path.dart"; 10 import "path.dart";
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 dartium: Run Dart or JavaScript in Dartium. 114 dartium: Run Dart or JavaScript in Dartium.
115 115
116 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell 116 ContentShellOnAndroid: Run Dart or JavaScript in Dartium content shell
117 on Android. 117 on Android.
118 118
119 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android. 119 DartiumOnAndroid: Run Dart or Javascript in Dartium on Android.
120 120
121 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]: 121 [ff | chrome | safari | ie9 | ie10 | ie11 | opera | chromeOnAndroid]:
122 Run JavaScript in the specified browser. 122 Run JavaScript in the specified browser.
123 123
124 self_check: Pass each test or its compiled output to every file under
125 `pkg` whose name ends with `_self_check.dart`.
126 Each test is given to the self_check tester as a filename on stdin using
127 the batch-mode protocol.
128
124 none: No runtime, compile only (for example, used for dart2analyzer static 129 none: No runtime, compile only (for example, used for dart2analyzer static
125 analysis tests).''', 130 analysis tests).''',
126 ['-r', '--runtime'], 131 ['-r', '--runtime'],
127 [ 132 [
128 'vm', 133 'vm',
129 'dart_precompiled', 134 'dart_precompiled',
130 'dart_app', // TODO(rmacnak): Remove after updating bots. 135 'dart_app', // TODO(rmacnak): Remove after updating bots.
131 'd8', 136 'd8',
132 'jsshell', 137 'jsshell',
133 'drt', 138 'drt',
134 'dartium', 139 'dartium',
135 'ff', 140 'ff',
136 'firefox', 141 'firefox',
137 'chrome', 142 'chrome',
138 'safari', 143 'safari',
139 'ie9', 144 'ie9',
140 'ie10', 145 'ie10',
141 'ie11', 146 'ie11',
142 'opera', 147 'opera',
143 'chromeOnAndroid', 148 'chromeOnAndroid',
144 'safarimobilesim', 149 'safarimobilesim',
145 'ContentShellOnAndroid', 150 'ContentShellOnAndroid',
146 'DartiumOnAndroid', 151 'DartiumOnAndroid',
152 'self_check',
147 'none' 153 'none'
148 ], 154 ],
149 'vm'), 155 'vm'),
150 new _TestOptionSpecification( 156 new _TestOptionSpecification(
151 'arch', 157 'arch',
152 'The architecture to run tests for', 158 'The architecture to run tests for',
153 ['-a', '--arch'], 159 ['-a', '--arch'],
154 [ 160 [
155 'all', 161 'all',
156 'ia32', 162 'ia32',
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 ['--packages'], 478 ['--packages'],
473 [], 479 [],
474 null), 480 null),
475 new _TestOptionSpecification( 481 new _TestOptionSpecification(
476 'exclude_suite', 482 'exclude_suite',
477 'Exclude suites from default selector, only works when no' 483 'Exclude suites from default selector, only works when no'
478 ' selector has been specified on the command line', 484 ' selector has been specified on the command line',
479 ['--exclude-suite'], 485 ['--exclude-suite'],
480 defaultTestSelectors, 486 defaultTestSelectors,
481 null), 487 null),
488 new _TestOptionSpecification(
489 'skip-compilation',
490 'Skip the compilation step, using the compilation artifacts left in '
491 ' the output folder from a previous run.'
492 'This flag will often cause false positves and negatives, but can be'
493 ' useful for quick-and-dirty offline testing when not making changes'
494 ' that affect the compiler.',
495 ['--skip-compilation'],
496 [],
497 false,
498 type: 'bool')
482 ]; 499 ];
483 } 500 }
484 501
485 /** 502 /**
486 * Parse a list of strings as test options. 503 * Parse a list of strings as test options.
487 * 504 *
488 * Returns a list of configurations in which to run the 505 * Returns a list of configurations in which to run the
489 * tests. Configurations are maps mapping from option keys to 506 * tests. Configurations are maps mapping from option keys to
490 * values. When encountering the first non-option string, the rest 507 * values. When encountering the first non-option string, the rest
491 * of the arguments are stored in the returned Map under the 'rest' 508 * of the arguments are stored in the returned Map under the 'rest'
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 'opera', 707 'opera',
691 'chromeOnAndroid', 708 'chromeOnAndroid',
692 'safarimobilesim' 709 'safarimobilesim'
693 ]; 710 ];
694 break; 711 break;
695 case 'dart2analyzer': 712 case 'dart2analyzer':
696 validRuntimes = const ['none']; 713 validRuntimes = const ['none'];
697 break; 714 break;
698 case 'app_jit': 715 case 'app_jit':
699 case 'dartk': 716 case 'dartk':
700 validRuntimes = const ['vm']; 717 validRuntimes = const ['vm', 'self_check', 'none'];
701 break; 718 break;
702 case 'precompiler': 719 case 'precompiler':
703 case 'dartkp': 720 case 'dartkp':
704 validRuntimes = const ['dart_precompiled']; 721 validRuntimes = const ['dart_precompiled'];
705 break; 722 break;
706 case 'none': 723 case 'none':
707 validRuntimes = const [ 724 validRuntimes = const [
708 'vm', 725 'vm',
709 'drt', 726 'drt',
710 'dartium', 727 'dartium',
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 if (option.keys.contains(name)) { 1013 if (option.keys.contains(name)) {
997 return option; 1014 return option;
998 } 1015 }
999 } 1016 }
1000 print('Unknown test option $name'); 1017 print('Unknown test option $name');
1001 exit(1); 1018 exit(1);
1002 } 1019 }
1003 1020
1004 List<_TestOptionSpecification> _options; 1021 List<_TestOptionSpecification> _options;
1005 } 1022 }
OLDNEW
« no previous file with comments | « tools/testing/dart/runtime_configuration.dart ('k') | tools/testing/dart/test_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698