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

Unified Diff: dart/tools/testing/dart/test_suite.dart

Issue 10151014: Run dart2js directly from test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix browser tests Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tools/testing/dart/test_suite.dart
diff --git a/dart/tools/testing/dart/test_suite.dart b/dart/tools/testing/dart/test_suite.dart
index c9f2d7bd818766775ffa7adf995169a21f215e11..5fea3590a1a32024820d02c7550daf264c3aa594 100644
--- a/dart/tools/testing/dart/test_suite.dart
+++ b/dart/tools/testing/dart/test_suite.dart
@@ -425,7 +425,7 @@ class StandardTestSuite implements TestSuite {
for (var args in argumentLists) {
doTest(new TestCase('$suiteName/$testName',
- [new Command(shellPath(), args)],
+ makeCommands(info, args),
configuration,
completeHandler,
expectations,
@@ -434,6 +434,24 @@ class StandardTestSuite implements TestSuite {
}
}
+ List<Command> makeCommands(TestInformation info, var args) {
+ if (configuration['compiler'] == 'dart2js') {
+ args = new List.from(args);
+ String testPath = info.filename.replaceAll('\\', '/');
+ Directory tempDir = createOutputDirectory(testPath, '');
+ args.add('--out=${tempDir.path}/out.js');
+ List<Command> commands = <Command>[new Command(shellPath(), args)];
+ if (configuration['runtime'] == 'd8') {
+ var d8 = '${TestUtils.buildDir(configuration)}/'
+ 'd8${TestUtils.executableSuffix("d8")}';
+ commands.add(new Command(d8, ['${tempDir.path}/out.js']));
+ }
+ return commands;
+ } else {
+ return <Command>[new Command(shellPath(), args)];
+ }
+ }
+
Function makeTestCaseCreator(Map optionsFromFile) {
return (String filename,
bool isNegative,
@@ -652,17 +670,20 @@ class StandardTestSuite implements TestSuite {
List<String> args = TestUtils.standardOptions(configuration);
switch (compiler) {
case 'frog':
- case 'dart2js':
String libdir = configuration['froglib'];
if (libdir == '') {
libdir = '$dartDir/frog/lib';
}
args.addAll(['--libdir=$libdir',
- '--compile-only',
- '--out=$outputFile']);
+ '--compile-only',
+ '--out=$outputFile']);
args.addAll(vmOptions);
args.add(inputFile);
break;
+ case 'dart2js':
+ args.add('--out=$outputFile');
+ args.add(inputFile);
+ break;
default:
Expect.fail('unimplemented compiler $compiler');
}
@@ -700,10 +721,12 @@ class StandardTestSuite implements TestSuite {
String testUniqueName =
testPath.substring(dartDir.length + 1, testPath.length - 5);
testUniqueName = testUniqueName.replaceAll('/', '_');
- testUniqueName += '-$optionsName';
+ if (!optionsName.isEmpty()) {
+ testUniqueName += '-$optionsName';
+ }
// Create '[build dir]/generated_tests/$compiler-$runtime/$testUniqueName',
- // including any intermediate directories that don't exist.
+ // including any intermediate directories that don't exist.
var generatedTestPath = ['generated_tests',
configuration['compiler'] + '-' +
configuration['runtime'],
@@ -827,8 +850,7 @@ class StandardTestSuite implements TestSuite {
args.add('--error_format');
args.add('machine');
}
- if ((configuration['compiler'] == 'frog'
- || configuration['compiler'] == 'dart2js')
+ if ((configuration['compiler'] == 'frog')
&& (configuration['runtime'] == 'none')) {
args.add('--compile-only');
}
@@ -836,6 +858,9 @@ class StandardTestSuite implements TestSuite {
bool isMultitest = optionsFromFile["isMultitest"];
List<String> dartOptions = optionsFromFile["dartOptions"];
List<List<String>> vmOptionsList = optionsFromFile["vmOptions"];
+ if (configuration['compiler'] == 'dart2js') {
+ vmOptionsList = [[]];
+ }
Expect.isTrue(!isMultitest || dartOptions == null);
if (dartOptions == null) {
args.add(filename);
@@ -1240,8 +1265,13 @@ class TestUtils {
return 'dart$suffix';
case 'dartc':
return 'compiler/bin/dartc$suffix';
- case 'frog':
case 'dart2js':
+ if (configuration['host_checked']) {
+ return 'dart2js_developer$suffix';
+ } else {
+ return 'dart2js$suffix';
+ }
+ case 'frog':
return 'frog/bin/frog$suffix';
default:
throw "Unknown executable for: ${configuration['compiler']}";
@@ -1253,8 +1283,13 @@ class TestUtils {
switch (configuration['compiler']) {
case 'dartc':
return 'compiler/bin/dartc$suffix';
- case 'frog':
case 'dart2js':
+ if (configuration['host_checked']) {
+ return 'dart2js_developer$suffix';
+ } else {
+ return 'dart2js$suffix';
+ }
+ case 'frog':
return 'frog/bin/frog$suffix';
default:
throw "Unknown compiler for: ${configuration['compiler']}";
@@ -1317,11 +1352,8 @@ class TestUtils {
args.add("--enable_type_checks");
}
if (configuration["compiler"] == "dart2js") {
+ args = [];
args.add("--verbose");
- args.add("--leg");
- if (configuration["host_checked"]) {
- args.add("--vm_flags=--enable_asserts --enable_type_checks");
- }
if (!isBrowserRuntime(configuration['runtime'])) {
args.add("--allow-mock-compilation");
}
« no previous file with comments | « dart/lib/compiler/implementation/dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698