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

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

Issue 11028023: Add firefox jsshell support in testing scripts. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 /** 5 /**
6 * Classes and methods for enumerating and preparing tests. 6 * Classes and methods for enumerating and preparing tests.
7 * 7 *
8 * This library includes: 8 * This library includes:
9 * 9 *
10 * - Creating tests by listing all the Dart files in certain directories, 10 * - Creating tests by listing all the Dart files in certain directories,
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 args = new List.from(args); 473 args = new List.from(args);
474 String tempDir = createOutputDirectory(info.filePath, ''); 474 String tempDir = createOutputDirectory(info.filePath, '');
475 args.add('--out=$tempDir/out.js'); 475 args.add('--out=$tempDir/out.js');
476 List<Command> commands = <Command>[new Command(shellPath(), args)]; 476 List<Command> commands = <Command>[new Command(shellPath(), args)];
477 if (info.hasCompileError) { 477 if (info.hasCompileError) {
478 // Do not attempt to run the compiled result. A compilation 478 // Do not attempt to run the compiled result. A compilation
479 // error should be reported by the compilation command. 479 // error should be reported by the compilation command.
480 } else if (configuration['runtime'] == 'd8') { 480 } else if (configuration['runtime'] == 'd8') {
481 var d8 = TestUtils.d8FileName(configuration); 481 var d8 = TestUtils.d8FileName(configuration);
482 commands.add(new Command(d8, ['$tempDir/out.js'])); 482 commands.add(new Command(d8, ['$tempDir/out.js']));
483 } else if (configuration['runtime'] == 'jsshell') {
ricow1 2012/10/04 10:39:13 we could combine the d8 case and this case by lett
484 var jsshell = TestUtils.jsshellFileName(configuration);
485 var environment = TestUtils.jsshellEnvironment(configuration);
486 commands.add(new Command(jsshell, ['$tempDir/out.js'], environment));
483 } 487 }
484 return commands; 488 return commands;
485 489
486 case 'dart2dart': 490 case 'dart2dart':
487 var compilerArguments = new List.from(args); 491 var compilerArguments = new List.from(args);
488 var additionalFlags = 492 var additionalFlags =
489 configuration['additional-compiler-flags'].split(' '); 493 configuration['additional-compiler-flags'].split(' ');
490 for (final flag in additionalFlags) { 494 for (final flag in additionalFlags) {
491 if (flag.isEmpty()) continue; 495 if (flag.isEmpty()) continue;
492 compilerArguments.add(flag); 496 compilerArguments.add(flag);
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 static Future copyFile(Path source, Path dest) { 1302 static Future copyFile(Path source, Path dest) {
1299 var output = new File.fromPath(dest).openOutputStream(); 1303 var output = new File.fromPath(dest).openOutputStream();
1300 new File.fromPath(source).openInputStream().pipe(output); 1304 new File.fromPath(source).openInputStream().pipe(output);
1301 var completer = new Completer(); 1305 var completer = new Completer();
1302 output.onClosed = (){ completer.complete(null); }; 1306 output.onClosed = (){ completer.complete(null); };
1303 return completer.future; 1307 return completer.future;
1304 } 1308 }
1305 1309
1306 static String executableSuffix(String executable) { 1310 static String executableSuffix(String executable) {
1307 if (Platform.operatingSystem == 'windows') { 1311 if (Platform.operatingSystem == 'windows') {
1308 if (executable == 'd8' || executable == 'vm' || executable == 'none') { 1312 if (executable == 'd8' ||
1313 executable == 'vm' ||
1314 executable == 'none' ||
1315 executable == 'jsshell') {
1309 return '.exe'; 1316 return '.exe';
1310 } else { 1317 } else {
1311 return '.bat'; 1318 return '.bat';
1312 } 1319 }
1313 } 1320 }
1314 return ''; 1321 return '';
1315 } 1322 }
1316 1323
1317 static String executableName(Map configuration) { 1324 static String executableName(Map configuration) {
1318 String suffix = executableSuffix(configuration['compiler']); 1325 String suffix = executableSuffix(configuration['compiler']);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1429 args.add('--enable-checked-mode'); 1436 args.add('--enable-checked-mode');
1430 } 1437 }
1431 // args.add("--verbose"); 1438 // args.add("--verbose");
1432 if (!isBrowserRuntime(configuration['runtime'])) { 1439 if (!isBrowserRuntime(configuration['runtime'])) {
1433 args.add("--allow-mock-compilation"); 1440 args.add("--allow-mock-compilation");
1434 } 1441 }
1435 } 1442 }
1436 return args; 1443 return args;
1437 } 1444 }
1438 1445
1446 static String jsshellDir(Map configuration) {
1447 return 'third_party/firefox_jsshell/${configuration['system']}';
1448 }
1449
1450 static String jsshellFileName(Map configuration) {
1451 var executableSuffix = executableSuffix('jsshell');
1452 var executable = 'js$executableSuffix';
1453 var jsshellDir = jsshellDir(configuration);
1454 return '$jsshellDir/$executable';
1455 }
1456
1457 static Map<String, String> jsshellEnvironment(Map configuration) {
1458 if (configuration['system'] == 'linux') {
1459 var jsshellDir = jsshellDir(configuration);
1460 return {'LD_LIBRARY_PATH': jsshellDir};
1461 }
1462 return {};
1463 }
1464
1439 static bool isBrowserRuntime(String runtime) => Contains( 1465 static bool isBrowserRuntime(String runtime) => Contains(
1440 runtime, 1466 runtime,
1441 const <String>['drt', 1467 const <String>['drt',
1442 'dartium', 1468 'dartium',
1443 'ie', 1469 'ie',
1444 'safari', 1470 'safari',
1445 'opera', 1471 'opera',
1446 'chrome', 1472 'chrome',
1447 'ff']); 1473 'ff']);
1474
1475 static bool isCommandLineRuntime(String runtime) => Contains(
1476 runtime,
1477 const <String>['d8',
1478 'jsshell']);
1479
1448 } 1480 }
1449 1481
1450 class SummaryReport { 1482 class SummaryReport {
1451 static int total = 0; 1483 static int total = 0;
1452 static int skipped = 0; 1484 static int skipped = 0;
1453 static int noCrash = 0; 1485 static int noCrash = 0;
1454 static int pass = 0; 1486 static int pass = 0;
1455 static int failOk = 0; 1487 static int failOk = 0;
1456 static int fail = 0; 1488 static int fail = 0;
1457 static int crash = 0; 1489 static int crash = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1491 * $noCrash tests are expected to be flaky but not crash 1523 * $noCrash tests are expected to be flaky but not crash
1492 * $pass tests are expected to pass 1524 * $pass tests are expected to pass
1493 * $failOk tests are expected to fail that we won't fix 1525 * $failOk tests are expected to fail that we won't fix
1494 * $fail tests are expected to fail that we should fix 1526 * $fail tests are expected to fail that we should fix
1495 * $crash tests are expected to crash that we should fix 1527 * $crash tests are expected to crash that we should fix
1496 * $timeout tests are allowed to timeout 1528 * $timeout tests are allowed to timeout
1497 """; 1529 """;
1498 print(report); 1530 print(report);
1499 } 1531 }
1500 } 1532 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698