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

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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 args = new List.from(args); 462 args = new List.from(args);
463 String tempDir = createOutputDirectory(info.filePath, ''); 463 String tempDir = createOutputDirectory(info.filePath, '');
464 args.add('--out=$tempDir/out.js'); 464 args.add('--out=$tempDir/out.js');
465 List<Command> commands = <Command>[new Command(shellPath(), args)]; 465 List<Command> commands = <Command>[new Command(shellPath(), args)];
466 if (info.hasCompileError) { 466 if (info.hasCompileError) {
467 // Do not attempt to run the compiled result. A compilation 467 // Do not attempt to run the compiled result. A compilation
468 // error should be reported by the compilation command. 468 // error should be reported by the compilation command.
469 } else if (configuration['runtime'] == 'd8') { 469 } else if (configuration['runtime'] == 'd8') {
470 var d8 = TestUtils.d8FileName(configuration); 470 var d8 = TestUtils.d8FileName(configuration);
471 commands.add(new Command(d8, ['$tempDir/out.js'])); 471 commands.add(new Command(d8, ['$tempDir/out.js']));
472 } else if (configuration['runtime'] == 'jsshell') {
473 var jsshell = TestUtils.jsshellFileName(configuration);
474 var environment = TestUtils.jsshellEnvironment(configuration);
475 commands.add(new Command(jsshell, ['$tempDir/out.js'], environment));
472 } 476 }
473 return commands; 477 return commands;
474 478
475 case 'dart2dart': 479 case 'dart2dart':
476 var compilerArguments = new List.from(args); 480 var compilerArguments = new List.from(args);
477 var additionalFlags = 481 var additionalFlags =
478 configuration['additional-compiler-flags'].split(' '); 482 configuration['additional-compiler-flags'].split(' ');
479 for (final flag in additionalFlags) { 483 for (final flag in additionalFlags) {
480 if (flag.isEmpty()) continue; 484 if (flag.isEmpty()) continue;
481 compilerArguments.add(flag); 485 compilerArguments.add(flag);
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1260 static Future copyFile(Path source, Path dest) { 1264 static Future copyFile(Path source, Path dest) {
1261 var output = new File.fromPath(dest).openOutputStream(); 1265 var output = new File.fromPath(dest).openOutputStream();
1262 new File.fromPath(source).openInputStream().pipe(output); 1266 new File.fromPath(source).openInputStream().pipe(output);
1263 var completer = new Completer(); 1267 var completer = new Completer();
1264 output.onClosed = (){ completer.complete(null); }; 1268 output.onClosed = (){ completer.complete(null); };
1265 return completer.future; 1269 return completer.future;
1266 } 1270 }
1267 1271
1268 static String executableSuffix(String executable) { 1272 static String executableSuffix(String executable) {
1269 if (Platform.operatingSystem == 'windows') { 1273 if (Platform.operatingSystem == 'windows') {
1270 if (executable == 'd8' || executable == 'vm' || executable == 'none') { 1274 if (executable == 'd8' ||
1275 executable == 'vm' ||
1276 executable == 'none' ||
1277 executable == 'jsshell') {
1271 return '.exe'; 1278 return '.exe';
1272 } else { 1279 } else {
1273 return '.bat'; 1280 return '.bat';
1274 } 1281 }
1275 } 1282 }
1276 return ''; 1283 return '';
1277 } 1284 }
1278 1285
1279 static String executableName(Map configuration) { 1286 static String executableName(Map configuration) {
1280 String suffix = executableSuffix(configuration['compiler']); 1287 String suffix = executableSuffix(configuration['compiler']);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 args.add('--enable-checked-mode'); 1398 args.add('--enable-checked-mode');
1392 } 1399 }
1393 // args.add("--verbose"); 1400 // args.add("--verbose");
1394 if (!isBrowserRuntime(configuration['runtime'])) { 1401 if (!isBrowserRuntime(configuration['runtime'])) {
1395 args.add("--allow-mock-compilation"); 1402 args.add("--allow-mock-compilation");
1396 } 1403 }
1397 } 1404 }
1398 return args; 1405 return args;
1399 } 1406 }
1400 1407
1408 static String jsshellDir(Map configuration) {
1409 var base = dartDir();
1410 return '$base/third_party/firefox_jsshell/${configuration['system']}';
1411 }
1412
1413 static String jsshellFileName(Map configuration) {
1414 var executableSuffix = executableSuffix('jsshell');
1415 var executable = 'js$executableSuffix';
1416 var jsshellDir = jsshellDir(configuration);
1417 return '$jsshellDir/$executable';
1418 }
1419
1420 static Map<String, String> jsshellEnvironment(Map configuration) {
1421 if (configuration['system'] == 'linux') {
1422 var jsshellDir = jsshellDir(configuration);
1423 return {'LD_LIBRARY_PATH': jsshellDir};
1424 }
1425 return {};
1426 }
1427
1401 static bool isBrowserRuntime(String runtime) => Contains( 1428 static bool isBrowserRuntime(String runtime) => Contains(
1402 runtime, 1429 runtime,
1403 const <String>['drt', 1430 const <String>['drt',
1404 'dartium', 1431 'dartium',
1405 'ie', 1432 'ie',
1406 'safari', 1433 'safari',
1407 'opera', 1434 'opera',
1408 'chrome', 1435 'chrome',
1409 'ff']); 1436 'ff']);
1437
1438 static bool isJsCommandLineRuntime(String runtime) =>
1439 Contains(runtime, const <String>['d8', 'jsshell']);
1440
1410 } 1441 }
1411 1442
1412 class SummaryReport { 1443 class SummaryReport {
1413 static int total = 0; 1444 static int total = 0;
1414 static int skipped = 0; 1445 static int skipped = 0;
1415 static int noCrash = 0; 1446 static int noCrash = 0;
1416 static int pass = 0; 1447 static int pass = 0;
1417 static int failOk = 0; 1448 static int failOk = 0;
1418 static int fail = 0; 1449 static int fail = 0;
1419 static int crash = 0; 1450 static int crash = 0;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 * $noCrash tests are expected to be flaky but not crash 1484 * $noCrash tests are expected to be flaky but not crash
1454 * $pass tests are expected to pass 1485 * $pass tests are expected to pass
1455 * $failOk tests are expected to fail that we won't fix 1486 * $failOk tests are expected to fail that we won't fix
1456 * $fail tests are expected to fail that we should fix 1487 * $fail tests are expected to fail that we should fix
1457 * $crash tests are expected to crash that we should fix 1488 * $crash tests are expected to crash that we should fix
1458 * $timeout tests are allowed to timeout 1489 * $timeout tests are allowed to timeout
1459 """; 1490 """;
1460 print(report); 1491 print(report);
1461 } 1492 }
1462 } 1493 }
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