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

Side by Side Diff: tools/test.dart

Issue 10584014: Change test scripts to use Path library in most places, instead of strings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bugs Created 8 years, 6 months 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 | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 /** 6 /**
7 * This file is the entrypoint of the dart test suite. This suite is used 7 * This file is the entrypoint of the dart test suite. This suite is used
8 * to test: 8 * to test:
9 * 9 *
10 * 1. the dart vm 10 * 1. the dart vm
11 * 2. the frog compiler (compiles dart to js) 11 * 2. the frog compiler (compiles dart to js)
12 * 3. the leg compiler (also compiles dart to js) 12 * 3. the leg compiler (also compiles dart to js)
13 * 4. the dartc static analyzer 13 * 4. the dartc static analyzer
14 * 5. the dart core library 14 * 5. the dart core library
15 * 6. other standard dart libraries (DOM bindings, ui libraries, 15 * 6. other standard dart libraries (DOM bindings, ui libraries,
16 * io libraries etc.) 16 * io libraries etc.)
17 * 17 *
18 * This script is normally invoked by test.py. (test.py finds the dart vm 18 * This script is normally invoked by test.py. (test.py finds the dart vm
19 * and passses along all command line arguments to this script.) 19 * and passses along all command line arguments to this script.)
20 * 20 *
21 * The command line args of this script are documented in 21 * The command line args of this script are documented in
22 * "tools/testing/test_options.dart". 22 * "tools/testing/test_options.dart".
23 * 23 *
24 */ 24 */
25 25
26 #library("test"); 26 #library("test");
27 27
28 #import("dart:io");
28 #import("testing/dart/test_runner.dart"); 29 #import("testing/dart/test_runner.dart");
29 #import("testing/dart/test_options.dart"); 30 #import("testing/dart/test_options.dart");
30 #import("testing/dart/test_suite.dart"); 31 #import("testing/dart/test_suite.dart");
31 32
32 #import("../compiler/tests/dartc/test_config.dart"); 33 #import("../compiler/tests/dartc/test_config.dart");
33 #import("../runtime/tests/vm/test_config.dart"); 34 #import("../runtime/tests/vm/test_config.dart");
34 #import("../samples/tests/dartc/test_config.dart"); 35 #import("../samples/tests/dartc/test_config.dart");
35 #import("../tests/co19/test_config.dart"); 36 #import("../tests/co19/test_config.dart");
36 37
37 /** 38 /**
38 * The directories that contain test suites which follow the conventions 39 * The directories that contain test suites which follow the conventions
39 * required by [StandardTestSuite]'s forDirectory constructor. 40 * required by [StandardTestSuite]'s forDirectory constructor.
40 * New test suites should follow this convention because it makes it much 41 * New test suites should follow this convention because it makes it much
41 * simpler to add them to test.dart. Existing test suites should be 42 * simpler to add them to test.dart. Existing test suites should be
42 * moved to here, if possible. 43 * moved to here, if possible.
43 */ 44 */
44 final TEST_SUITE_DIRECTORIES = const [ 45 final TEST_SUITE_DIRECTORIES = const [
45 'frog/tests/await', 46 const Path('frog/tests/await'),
46 'frog/tests/frog', 47 const Path('frog/tests/frog'),
47 'runtime/tests/vm', 48 const Path('runtime/tests/vm'),
48 'samples/tests/samples', 49 const Path('samples/tests/samples'),
49 'tests/benchmark_smoke', 50 const Path('tests/benchmark_smoke'),
50 'tests/compiler/dart2js', 51 const Path('tests/compiler/dart2js'),
51 'tests/compiler/dart2js_extra', 52 const Path('tests/compiler/dart2js_extra'),
52 'tests/compiler/dart2js_native', 53 const Path('tests/compiler/dart2js_native'),
53 'tests/corelib', 54 const Path('tests/corelib'),
54 'tests/dom', 55 const Path('tests/dom'),
55 'tests/html', 56 const Path('tests/html'),
56 'tests/isolate', 57 const Path('tests/isolate'),
57 'tests/json', 58 const Path('tests/json'),
58 'tests/language', 59 const Path('tests/language'),
59 'tests/lib', 60 const Path('tests/lib'),
60 'tests/standalone', 61 const Path('tests/standalone'),
61 'tests/utils', 62 const Path('tests/utils'),
62 'utils/tests/css', 63 const Path('utils/tests/css'),
63 'utils/tests/peg', 64 const Path('utils/tests/peg'),
64 'utils/tests/pub', 65 const Path('utils/tests/pub'),
65 ]; 66 ];
66 67
67 main() { 68 main() {
68 var startTime = new Date.now(); 69 var startTime = new Date.now();
69 var optionsParser = new TestOptionsParser(); 70 var optionsParser = new TestOptionsParser();
70 List<Map> configurations = optionsParser.parse(new Options().arguments); 71 List<Map> configurations = optionsParser.parse(new Options().arguments);
71 if (configurations == null || configurations.length == 0) return; 72 if (configurations == null || configurations.length == 0) return;
72 73
73 // Extract global options from first configuration. 74 // Extract global options from first configuration.
74 var firstConf = configurations[0]; 75 var firstConf = configurations[0];
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 // vm tests contain both cc tests (added here) and dart tests (added in 109 // vm tests contain both cc tests (added here) and dart tests (added in
109 // [TEST_SUITE_DIRECTORIES]). 110 // [TEST_SUITE_DIRECTORIES]).
110 queue.addTestSuite(new VMTestSuite(conf)); 111 queue.addTestSuite(new VMTestSuite(conf));
111 } else if (conf['compiler'] == 'dartc' && key == 'dartc') { 112 } else if (conf['compiler'] == 'dartc' && key == 'dartc') {
112 queue.addTestSuite(new SamplesDartcTestSuite(conf)); 113 queue.addTestSuite(new SamplesDartcTestSuite(conf));
113 queue.addTestSuite(new JUnitDartcTestSuite(conf)); 114 queue.addTestSuite(new JUnitDartcTestSuite(conf));
114 } 115 }
115 } 116 }
116 117
117 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) { 118 for (final testSuiteDir in TEST_SUITE_DIRECTORIES) {
118 final name = testSuiteDir.substring(testSuiteDir.lastIndexOf('/') + 1); 119 final name = testSuiteDir.filename;
119 if (selectors.containsKey(name)) { 120 if (selectors.containsKey(name)) {
120 queue.addTestSuite( 121 queue.addTestSuite(
121 new StandardTestSuite.forDirectory(conf, testSuiteDir)); 122 new StandardTestSuite.forDirectory(conf, testSuiteDir));
122 } 123 }
123 } 124 }
124 125
125 return true; 126 return true;
126 } 127 }
127 128
128 // Start process queue. 129 // Start process queue.
129 var queue = new ProcessQueue(maxProcesses, 130 var queue = new ProcessQueue(maxProcesses,
130 progressIndicator, 131 progressIndicator,
131 startTime, 132 startTime,
132 printTiming, 133 printTiming,
133 enqueueConfiguration, 134 enqueueConfiguration,
134 verbose, 135 verbose,
135 listTests); 136 listTests);
136 } 137 }
OLDNEW
« no previous file with comments | « tests/co19/test_config.dart ('k') | tools/test-runtime.dart » ('j') | tools/test-runtime.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698