Files
sdk/tools/test-runtime.dart
T
whesse@google.com a4e88c8b3e Remove string concatenation with + from all Dart files in tools directory.
Fix whitespace errors and rename shadowed variable in ddbg.dart.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10387232

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7897 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 08:51:38 +00:00

103 lines
3.6 KiB
Dart
Executable File

#!/usr/bin/env dart
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// TODO(ager): Get rid of this version of test.dart when we don't have
// to worry about the special runtime checkout anymore.
// This file is identical to test.dart with test suites in the
// directories samples, client, compiler, frog, and utils removed.
#library("test");
#import("testing/dart/test_runner.dart");
#import("testing/dart/test_options.dart");
#import("testing/dart/test_suite.dart");
#import("../tests/co19/test_config.dart");
#import("../runtime/tests/vm/test_config.dart");
/**
* The directories that contain test suites which follow the conventions
* required by [StandardTestSuite]'s forDirectory constructor.
* New test suites should follow this convention because it makes it much
* simpler to add them to test.dart. Existing test suites should be
* moved to here, if possible.
*/
final TEST_SUITE_DIRECTORIES = const [
'runtime/tests/vm',
'tests/corelib',
'tests/isolate',
'tests/language',
'tests/lib',
'tests/standalone',
'tests/utils',
];
main() {
var startTime = new Date.now();
var optionsParser = new TestOptionsParser();
List<Map> configurations = optionsParser.parse(new Options().arguments);
if (configurations == null) return;
// Extract global options from first configuration.
var firstConf = configurations[0];
Map<String, RegExp> selectors = firstConf['selectors'];
var maxProcesses = firstConf['tasks'];
var progressIndicator = firstConf['progress'];
var verbose = firstConf['verbose'];
var printTiming = firstConf['time'];
var listTests = firstConf['list'];
// Print the configurations being run by this execution of
// test.dart. However, don't do it if the silent progress indicator
// is used. This is only needed because of the junit tests.
if (progressIndicator != 'silent') {
List output_words = configurations.length > 1 ?
['Test configurations:'] : ['Test configuration:'];
for (Map conf in configurations) {
List settings =
['compiler', 'runtime', 'mode', 'arch'].map((name) => conf[name]);
if (conf['checked']) settings.add('checked');
output_words.add(Strings.join(settings, '_'));
}
print(Strings.join(output_words, ' '));
}
var configurationIterator = configurations.iterator();
bool enqueueConfiguration(ProcessQueue queue) {
if (!configurationIterator.hasNext()) {
return false;
}
var conf = configurationIterator.next();
if (selectors.containsKey('co19')) {
queue.addTestSuite(new Co19TestSuite(conf));
}
if (conf['runtime'] == 'vm' && selectors.containsKey('vm')) {
// vm tests contain both cc tests (added here) and dart tests (added in
// [TEST_SUITE_DIRECTORIES]).
queue.addTestSuite(new VMTestSuite(conf));
}
for (final testSuiteDir in TEST_SUITE_DIRECTORIES) {
final name = testSuiteDir.substring(testSuiteDir.lastIndexOf('/') + 1);
if (selectors.containsKey(name)) {
queue.addTestSuite(
new StandardTestSuite.forDirectory(conf, testSuiteDir));
}
}
return true;
}
// Start process queue.
var queue = new ProcessQueue(maxProcesses,
progressIndicator,
startTime,
printTiming,
enqueueConfiguration,
verbose,
listTests);
}