OLD | NEW |
---|---|
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, |
11 * and creating [TestCase]s for those files that meet the relevant criteria. | 11 * and creating [TestCase]s for those files that meet the relevant criteria. |
12 * - Preparing tests, including copying files and frameworks to temporary | 12 * - Preparing tests, including copying files and frameworks to temporary |
13 * directories, and computing the command line and arguments to be run. | 13 * directories, and computing the command line and arguments to be run. |
14 */ | 14 */ |
15 library test_suite; | 15 library test_suite; |
16 | 16 |
17 import "dart:async"; | 17 import "dart:async"; |
18 import "dart:io"; | 18 import "dart:io"; |
19 import "dart:isolate"; | 19 import "dart:isolate"; |
20 import "status_file_parser.dart"; | 20 import "status_file_parser.dart"; |
21 import "test_runner.dart"; | 21 import "test_runner.dart"; |
22 import "multitest.dart"; | 22 import "multitest.dart"; |
23 import "drt_updater.dart"; | 23 import "drt_updater.dart"; |
24 import "dart:uri"; | 24 import "dart:uri"; |
25 import '../../../pkg/path/lib/path.dart' as pathLib; | |
25 | 26 |
26 part "browser_test.dart"; | 27 part "browser_test.dart"; |
27 | 28 |
28 | 29 |
29 // TODO(rnystrom): Add to dart:core? | 30 // TODO(rnystrom): Add to dart:core? |
30 /** | 31 /** |
31 * A simple function that tests [arg] and returns `true` or `false`. | 32 * A simple function that tests [arg] and returns `true` or `false`. |
32 */ | 33 */ |
33 typedef bool Predicate<T>(T arg); | 34 typedef bool Predicate<T>(T arg); |
34 | 35 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
401 */ | 402 */ |
402 class StandardTestSuite extends TestSuite { | 403 class StandardTestSuite extends TestSuite { |
403 final Path suiteDir; | 404 final Path suiteDir; |
404 final List<String> statusFilePaths; | 405 final List<String> statusFilePaths; |
405 TestCaseEvent doTest; | 406 TestCaseEvent doTest; |
406 TestExpectations testExpectations; | 407 TestExpectations testExpectations; |
407 List<TestInformation> cachedTests; | 408 List<TestInformation> cachedTests; |
408 final Path dartDir; | 409 final Path dartDir; |
409 Predicate<String> isTestFilePredicate; | 410 Predicate<String> isTestFilePredicate; |
410 final bool listRecursively; | 411 final bool listRecursively; |
412 /** | |
413 * The set of servers that have been started to run these tests (Could be | |
414 * none). | |
415 */ | |
416 List serverList; | |
411 | 417 |
412 StandardTestSuite(Map configuration, | 418 StandardTestSuite(Map configuration, |
413 String suiteName, | 419 String suiteName, |
414 Path suiteDirectory, | 420 Path suiteDirectory, |
415 this.statusFilePaths, | 421 this.statusFilePaths, |
422 this.serverList, | |
ahe
2013/01/10 09:17:58
Why not use a named argument?
Emily Fortuna
2013/01/11 02:57:12
good idea. fixed.
| |
416 {this.isTestFilePredicate, | 423 {this.isTestFilePredicate, |
417 bool recursive: false}) | 424 bool recursive: false}) |
418 : super(configuration, suiteName), | 425 : super(configuration, suiteName), |
419 dartDir = TestUtils.dartDir(), | 426 dartDir = TestUtils.dartDir(), |
420 listRecursively = recursive, | 427 listRecursively = recursive, |
421 suiteDir = TestUtils.dartDir().join(suiteDirectory); | 428 suiteDir = TestUtils.dartDir().join(suiteDirectory); |
422 | 429 |
423 /** | 430 /** |
424 * Creates a test suite whose file organization matches an expected structure. | 431 * Creates a test suite whose file organization matches an expected structure. |
425 * To use this, your suite should look like: | 432 * To use this, your suite should look like: |
(...skipping 13 matching lines...) Expand all Loading... | |
439 * * The status file uses the same name. | 446 * * The status file uses the same name. |
440 * * Test files are directly in that directory and end in "_test.dart". | 447 * * Test files are directly in that directory and end in "_test.dart". |
441 * | 448 * |
442 * If you follow that convention, then you can construct one of these like: | 449 * If you follow that convention, then you can construct one of these like: |
443 * | 450 * |
444 * new StandardTestSuite.forDirectory(configuration, 'path/to/mytestsuite'); | 451 * new StandardTestSuite.forDirectory(configuration, 'path/to/mytestsuite'); |
445 * | 452 * |
446 * instead of having to create a custom [StandardTestSuite] subclass. In | 453 * instead of having to create a custom [StandardTestSuite] subclass. In |
447 * particular, if you add 'path/to/mytestsuite' to [TEST_SUITE_DIRECTORIES] | 454 * particular, if you add 'path/to/mytestsuite' to [TEST_SUITE_DIRECTORIES] |
448 * in test.dart, this will all be set up for you. | 455 * in test.dart, this will all be set up for you. |
456 * | |
457 * The [StandardTestSuite] also optionally takes a list of servers that have | |
458 * been started up by the test harness, to be used by browser tests. | |
449 */ | 459 */ |
450 factory StandardTestSuite.forDirectory( | 460 factory StandardTestSuite.forDirectory( |
451 Map configuration, Path directory) { | 461 Map configuration, Path directory, [List serverList = const []]) { |
452 final name = directory.filename; | 462 final name = directory.filename; |
453 | 463 |
454 return new StandardTestSuite(configuration, | 464 return new StandardTestSuite(configuration, |
455 name, directory, | 465 name, directory, |
456 ['$directory/$name.status', '$directory/${name}_dart2js.status'], | 466 ['$directory/$name.status', '$directory/${name}_dart2js.status'], |
467 serverList, | |
457 isTestFilePredicate: (filename) => filename.endsWith('_test.dart'), | 468 isTestFilePredicate: (filename) => filename.endsWith('_test.dart'), |
458 recursive: true); | 469 recursive: true); |
459 } | 470 } |
460 | 471 |
461 Collection<Uri> get dart2JsBootstrapDependencies { | 472 Collection<Uri> get dart2JsBootstrapDependencies { |
462 if (!useSdk) return []; | 473 if (!useSdk) return []; |
463 | 474 |
464 var snapshotPath = TestUtils.absolutePath(new Path(buildDir).join( | 475 var snapshotPath = TestUtils.absolutePath(new Path(buildDir).join( |
465 new Path('dart-sdk/lib/_internal/compiler/' | 476 new Path('dart-sdk/lib/_internal/compiler/' |
466 'implementation/dart2js.dart.snapshot'))).toString(); | 477 'implementation/dart2js.dart.snapshot'))).toString(); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
853 dartLibraryFilename = new Path('test_as_library.dart'); | 864 dartLibraryFilename = new Path('test_as_library.dart'); |
854 File file = new File('$tempDir/$dartLibraryFilename'); | 865 File file = new File('$tempDir/$dartLibraryFilename'); |
855 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); | 866 RandomAccessFile dartLibrary = file.openSync(FileMode.WRITE); |
856 dartLibrary.writeStringSync(wrapDartTestInLibrary(filePath)); | 867 dartLibrary.writeStringSync(wrapDartTestInLibrary(filePath)); |
857 dartLibrary.closeSync(); | 868 dartLibrary.closeSync(); |
858 } | 869 } |
859 | 870 |
860 File file = new File(dartWrapperFilename); | 871 File file = new File(dartWrapperFilename); |
861 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); | 872 RandomAccessFile dartWrapper = file.openSync(FileMode.WRITE); |
862 dartWrapper.writeStringSync( | 873 dartWrapper.writeStringSync( |
863 dartTestWrapper(dartDir, dartLibraryFilename)); | 874 dartTestWrapper(dartDir, file.name, dartLibraryFilename)); |
864 dartWrapper.closeSync(); | 875 dartWrapper.closeSync(); |
865 } else { | 876 } else { |
866 dartWrapperFilename = filename; | 877 dartWrapperFilename = filename; |
867 // TODO(whesse): Once test.py is retired, adjust the relative path in | 878 // TODO(whesse): Once test.py is retired, adjust the relative path in |
868 // the client/samples/dartcombat test to its css file, remove the | 879 // the client/samples/dartcombat test to its css file, remove the |
869 // "../../" from this path, and move this out of the isWebTest guard. | 880 // "../../" from this path, and move this out of the isWebTest guard. |
870 // Also remove getHtmlName, and just use test.html. | 881 // Also remove getHtmlName, and just use test.html. |
871 // TODO(efortuna): this shortening of htmlFilename is a band-aid until | 882 // TODO(efortuna): this shortening of htmlFilename is a band-aid until |
872 // the above TODO gets fixed. Windows cannot have paths that are longer | 883 // the above TODO gets fixed. Windows cannot have paths that are longer |
873 // than 260 characters, and without this hack, we were running past the | 884 // than 260 characters, and without this hack, we were running past the |
874 // the limit. | 885 // the limit. |
875 String htmlFilename = getHtmlName(filename); | 886 String htmlFilename = getHtmlName(filename); |
876 while ('$tempDir/../$htmlFilename'.length >= 260) { | 887 while ('$tempDir/../$htmlFilename'.length >= 260) { |
877 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); | 888 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); |
878 } | 889 } |
879 htmlPath = '$tempDir/../$htmlFilename'; | 890 htmlPath = '$tempDir/../$htmlFilename'; |
880 } | 891 } |
881 final String scriptPath = (compiler == 'none') ? | 892 final String scriptPath = (compiler == 'none') ? |
882 dartWrapperFilename : compiledDartWrapperFilename; | 893 dartWrapperFilename : compiledDartWrapperFilename; |
883 // Create the HTML file for the test. | 894 // Create the HTML file for the test. |
884 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); | 895 RandomAccessFile htmlTest = new File(htmlPath).openSync(FileMode.WRITE); |
885 String filePrefix = ''; | |
886 if (Platform.operatingSystem == 'windows') { | |
887 // Firefox on Windows does not like absolute file path names that start | |
888 // with 'C:' adding 'file:///' solves the problem. | |
889 filePrefix = 'file:///'; | |
890 } | |
891 String content = null; | 896 String content = null; |
892 Path dir = filePath.directoryPath; | 897 Path dir = filePath.directoryPath; |
893 String nameNoExt = filePath.filenameWithoutExtension; | 898 String nameNoExt = filePath.filenameWithoutExtension; |
894 Path pngPath = dir.append('$nameNoExt.png'); | 899 Path pngPath = dir.append('$nameNoExt.png'); |
895 Path txtPath = dir.append('$nameNoExt.txt'); | 900 Path txtPath = dir.append('$nameNoExt.txt'); |
896 Path expectedOutput = null; | 901 Path expectedOutput = null; |
897 if (new File.fromPath(pngPath).existsSync()) { | 902 if (new File.fromPath(pngPath).existsSync()) { |
898 expectedOutput = pngPath; | 903 expectedOutput = pngPath; |
899 content = getHtmlLayoutContents(scriptType, '$filePrefix$scriptPath'); | 904 content = getHtmlLayoutContents(scriptType, pathLib.relative(scriptPath, |
905 from: pathLib.dirname(htmlPath))); | |
900 } else if (new File.fromPath(txtPath).existsSync()) { | 906 } else if (new File.fromPath(txtPath).existsSync()) { |
901 expectedOutput = txtPath; | 907 expectedOutput = txtPath; |
902 content = getHtmlLayoutContents(scriptType, '$filePrefix$scriptPath'); | 908 content = getHtmlLayoutContents(scriptType, pathLib.relative(scriptPath, |
909 from: pathLib.dirname(htmlPath))); | |
903 } else { | 910 } else { |
904 final htmlLocation = new Path.fromNative(htmlPath); | 911 final htmlLocation = new Path.fromNative(htmlPath); |
905 content = getHtmlContents( | 912 content = getHtmlContents( |
906 filename, | 913 filename, |
907 dartDir.append('pkg/unittest/test_controller.js') | 914 dartDir.append('pkg/unittest/test_controller.js') |
908 .relativeTo(htmlLocation), | 915 .relativeTo(htmlLocation), |
909 dartDir.append('pkg/browser/lib/dart.js').relativeTo(htmlLocation), | 916 dartDir.append('pkg/browser/lib/dart.js').relativeTo(htmlLocation), |
910 scriptType, | 917 scriptType, |
911 new Path.fromNative(scriptPath).relativeTo(htmlLocation)); | 918 new Path.fromNative(scriptPath).relativeTo(htmlLocation)); |
912 } | 919 } |
(...skipping 29 matching lines...) Expand all Loading... | |
942 do { | 949 do { |
943 List<Command> commandSet = new List<Command>.from(commands); | 950 List<Command> commandSet = new List<Command>.from(commands); |
944 if (subtestIndex != 0) { | 951 if (subtestIndex != 0) { |
945 // NOTE: The first time we enter this loop, all the compilation | 952 // NOTE: The first time we enter this loop, all the compilation |
946 // commands will be executed. On subsequent loop iterations, we | 953 // commands will be executed. On subsequent loop iterations, we |
947 // don't need to do any compilations. Thus we set "commandSet = []". | 954 // don't need to do any compilations. Thus we set "commandSet = []". |
948 commandSet = []; | 955 commandSet = []; |
949 } | 956 } |
950 | 957 |
951 List<String> args = <String>[]; | 958 List<String> args = <String>[]; |
952 String fullHtmlPath = htmlPath.startsWith('http:') ? htmlPath : | 959 var basePath = TestUtils.dartDir().toString(); |
953 (htmlPath.startsWith('/') ? | 960 if (!htmlPath.startsWith('/') && !htmlPath.startsWith('http')) { |
954 'file://$htmlPath' : | 961 htmlPath = '/$htmlPath'; |
955 'file:///$htmlPath'); | 962 } |
963 htmlPath = htmlPath.startsWith(basePath) ? | |
964 htmlPath.substring(basePath.length) : htmlPath; | |
965 String fullHtmlPath = htmlPath; | |
966 if (!htmlPath.startsWith('http')) { | |
967 fullHtmlPath = 'http://127.0.0.1:${serverList[0].port}$htmlPath?' | |
968 'crossOriginPort=${serverList[1].port}'; | |
969 } | |
956 if (info.optionsFromFile['isMultiHtmlTest'] | 970 if (info.optionsFromFile['isMultiHtmlTest'] |
957 && subtestNames.length > 0) { | 971 && subtestNames.length > 0) { |
958 fullHtmlPath = '${fullHtmlPath}#${subtestNames[subtestIndex]}'; | 972 fullHtmlPath = '${fullHtmlPath}#${subtestNames[subtestIndex]}'; |
959 } | 973 } |
960 | 974 |
961 if (TestUtils.usesWebDriver(runtime)) { | 975 if (TestUtils.usesWebDriver(runtime)) { |
962 args = [ | 976 args = [ |
963 dartDir.append('tools/testing/run_selenium.py').toNativePath(), | 977 dartDir.append('tools/testing/run_selenium.py').toNativePath(), |
964 '--browser=$runtime', | 978 '--browser=$runtime', |
965 '--timeout=${configuration["timeout"] - 2}', | 979 '--timeout=${configuration["timeout"] - 2}', |
966 '--out="$fullHtmlPath"']; | 980 '--out="$fullHtmlPath"']; |
967 if (runtime == 'dartium') { | 981 if (runtime == 'dartium') { |
968 args.add('--executable=$dartiumFilename'); | 982 args.add('--executable=$dartiumFilename'); |
969 } | 983 } |
970 if (subtestIndex != 0) { | 984 if (subtestIndex != 0) { |
971 args.add('--force-refresh'); | 985 args.add('--force-refresh'); |
972 } | 986 } |
973 commandSet.add(new Command('python', args)); | 987 commandSet.add(new Command('python', args)); |
974 } else { | 988 } else { |
975 Expect.isTrue(runtime == "drt"); | 989 Expect.isTrue(runtime == "drt"); |
976 | 990 |
977 var dartFlags = []; | 991 var dartFlags = []; |
978 var dumpRenderTreeOptions = []; | 992 var dumpRenderTreeOptions = []; |
979 var packageRootUri; | |
980 | 993 |
981 dumpRenderTreeOptions.add('--no-timeout'); | 994 dumpRenderTreeOptions.add('--no-timeout'); |
982 | 995 |
983 if (compiler == 'none' || compiler == 'dart2dart') { | 996 if (compiler == 'none' || compiler == 'dart2dart') { |
984 dartFlags.add('--ignore-unrecognized-flags'); | 997 dartFlags.add('--ignore-unrecognized-flags'); |
985 if (configuration["checked"]) { | 998 if (configuration["checked"]) { |
986 dartFlags.add('--enable_asserts'); | 999 dartFlags.add('--enable_asserts'); |
987 dartFlags.add("--enable_type_checks"); | 1000 dartFlags.add("--enable_type_checks"); |
988 } | 1001 } |
989 dartFlags.addAll(vmOptions); | 1002 dartFlags.addAll(vmOptions); |
990 } | 1003 } |
991 if (compiler == 'none') { | |
992 var packageRootPath = packageRoot(optionsFromFile['packageRoot']); | |
993 if (packageRootPath != null) { | |
994 var absolutePath = | |
995 TestUtils.absolutePath(new Path(packageRootPath)); | |
996 packageRootUri = new Uri.fromComponents( | |
997 scheme: 'file', | |
998 path: absolutePath.toString()); | |
999 } | |
1000 } | |
1001 | 1004 |
1002 if (expectedOutput != null) { | 1005 if (expectedOutput != null) { |
1003 if (expectedOutput.toNativePath().endsWith('.png')) { | 1006 if (expectedOutput.toNativePath().endsWith('.png')) { |
1004 // pixel tests are specified by running DRT "foo.html'-p" | 1007 // pixel tests are specified by running DRT "foo.html'-p" |
1005 dumpRenderTreeOptions.add('--notree'); | 1008 dumpRenderTreeOptions.add('--notree'); |
1006 fullHtmlPath = "${fullHtmlPath}'-p"; | 1009 fullHtmlPath = "${fullHtmlPath}'-p"; |
1007 } | 1010 } |
1008 } | 1011 } |
1009 commandSet.add(new DumpRenderTreeCommand(dumpRenderTreeFilename, | 1012 commandSet.add(new DumpRenderTreeCommand(dumpRenderTreeFilename, |
1010 fullHtmlPath, | 1013 fullHtmlPath, |
1011 dumpRenderTreeOptions, | 1014 dumpRenderTreeOptions, |
1012 dartFlags, | 1015 dartFlags, |
1013 packageRootUri, | |
1014 expectedOutput)); | 1016 expectedOutput)); |
1015 } | 1017 } |
1016 | 1018 |
1017 // Create BrowserTestCase and queue it. | 1019 // Create BrowserTestCase and queue it. |
1018 String testDisplayName = '$suiteName/$testName'; | 1020 String testDisplayName = '$suiteName/$testName'; |
1019 var testCase; | 1021 var testCase; |
1020 if (info.optionsFromFile['isMultiHtmlTest']) { | 1022 if (info.optionsFromFile['isMultiHtmlTest']) { |
1021 testDisplayName = '$testDisplayName/${subtestNames[subtestIndex]}'; | 1023 testDisplayName = '$testDisplayName/${subtestNames[subtestIndex]}'; |
1022 testCase = new BrowserTestCase(testDisplayName, | 1024 testCase = new BrowserTestCase(testDisplayName, |
1023 commandSet, configuration, completeHandler, | 1025 commandSet, configuration, completeHandler, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1097 } | 1099 } |
1098 | 1100 |
1099 // Create '[build dir]/generated_tests/$compiler-$runtime/$testUniqueName', | 1101 // Create '[build dir]/generated_tests/$compiler-$runtime/$testUniqueName', |
1100 // including any intermediate directories that don't exist. | 1102 // including any intermediate directories that don't exist. |
1101 // If the tests are run in checked or minified mode we add that to the | 1103 // If the tests are run in checked or minified mode we add that to the |
1102 // '$compile-$runtime' directory name. | 1104 // '$compile-$runtime' directory name. |
1103 var checked = configuration['checked'] ? '-checked' : ''; | 1105 var checked = configuration['checked'] ? '-checked' : ''; |
1104 var minified = configuration['minified'] ? '-minified' : ''; | 1106 var minified = configuration['minified'] ? '-minified' : ''; |
1105 var dirName = "${configuration['compiler']}-${configuration['runtime']}" | 1107 var dirName = "${configuration['compiler']}-${configuration['runtime']}" |
1106 "$checked$minified"; | 1108 "$checked$minified"; |
1107 Path generatedTestPath = new Path.fromNative(buildDir) | 1109 Path generatedTestPath = new Path.fromNative(dartDir.toString()) |
1110 .append(buildDir.toString()) | |
1108 .append('generated_tests') | 1111 .append('generated_tests') |
1109 .append(dirName) | 1112 .append(dirName) |
1110 .append(testUniqueName); | 1113 .append(testUniqueName); |
1111 | 1114 |
1112 TestUtils.mkdirRecursive(new Path('.'), generatedTestPath); | 1115 TestUtils.mkdirRecursive(new Path('.'), generatedTestPath); |
1113 return new File.fromPath(generatedTestPath).fullPathSync() | 1116 return new File.fromPath(generatedTestPath).fullPathSync() |
1114 .replaceAll('\\', '/'); | 1117 .replaceAll('\\', '/'); |
1115 } | 1118 } |
1116 | 1119 |
1117 String get scriptType { | 1120 String get scriptType { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1438 List<String> _testDirs; | 1441 List<String> _testDirs; |
1439 | 1442 |
1440 DartcCompilationTestSuite(Map configuration, | 1443 DartcCompilationTestSuite(Map configuration, |
1441 String suiteName, | 1444 String suiteName, |
1442 String directoryPath, | 1445 String directoryPath, |
1443 List<String> this._testDirs, | 1446 List<String> this._testDirs, |
1444 List<String> expectations) | 1447 List<String> expectations) |
1445 : super(configuration, | 1448 : super(configuration, |
1446 suiteName, | 1449 suiteName, |
1447 new Path.fromNative(directoryPath), | 1450 new Path.fromNative(directoryPath), |
1448 expectations); | 1451 expectations, |
1452 []); | |
1449 | 1453 |
1450 List<String> additionalOptions(Path filePath) { | 1454 List<String> additionalOptions(Path filePath) { |
1451 return ['--fatal-warnings', '--fatal-type-errors']; | 1455 return ['--fatal-warnings', '--fatal-type-errors']; |
1452 } | 1456 } |
1453 | 1457 |
1454 Future enqueueTests() { | 1458 Future enqueueTests() { |
1455 var group = new FutureGroup(); | 1459 var group = new FutureGroup(); |
1456 | 1460 |
1457 for (String testDir in _testDirs) { | 1461 for (String testDir in _testDirs) { |
1458 Directory dir = new Directory.fromPath(suiteDir.append(testDir)); | 1462 Directory dir = new Directory.fromPath(suiteDir.append(testDir)); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1749 outputDir = 'out/'; | 1753 outputDir = 'out/'; |
1750 } else if (system == 'macos') { | 1754 } else if (system == 'macos') { |
1751 outputDir = 'xcodebuild/'; | 1755 outputDir = 'xcodebuild/'; |
1752 } else if (system == 'windows') { | 1756 } else if (system == 'windows') { |
1753 outputDir = 'build/'; | 1757 outputDir = 'build/'; |
1754 } | 1758 } |
1755 return "$outputDir${configurationDir(configuration)}"; | 1759 return "$outputDir${configurationDir(configuration)}"; |
1756 } | 1760 } |
1757 | 1761 |
1758 static String configurationDir(Map configuration) { | 1762 static String configurationDir(Map configuration) { |
1763 // For regular dart checkouts, the configDir by default is mode+arch. | |
1764 // For Dartium, the configDir by default is mode (as defined by the Chrome | |
1765 // build setup). We can detect this because in the dartium checkout, the | |
1766 // "output" directory is a sibling of the dart directory instead of a child. | |
1759 var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release'; | 1767 var mode = (configuration['mode'] == 'debug') ? 'Debug' : 'Release'; |
1760 var arch = configuration['arch'].toUpperCase(); | 1768 var arch = configuration['arch'].toUpperCase(); |
1761 return '$mode$arch'; | 1769 if (currentWorkingDirectory != dartDir()) { |
1770 return '$mode$arch'; | |
1771 } else { | |
1772 return mode; | |
1773 } | |
1774 } | |
1775 | |
1776 /** | |
1777 * Returns the path to the dart binary checked into the repo, used for | |
1778 * bootstrapping test.dart. | |
1779 */ | |
1780 static String get dartTestExecutable { | |
1781 var path = '${TestUtils.dartDir()}/tools/testing/bin/' | |
1782 '${Platform.operatingSystem}/dart'; | |
1783 if (Platform.operatingSystem == 'windows') { | |
1784 path.append('.exe'); | |
1785 } | |
1786 return path; | |
kustermann
2013/01/10 09:05:42
We should really use the Path class everywhere we
| |
1762 } | 1787 } |
1763 } | 1788 } |
1764 | 1789 |
1765 class SummaryReport { | 1790 class SummaryReport { |
1766 static int total = 0; | 1791 static int total = 0; |
1767 static int skipped = 0; | 1792 static int skipped = 0; |
1768 static int noCrash = 0; | 1793 static int noCrash = 0; |
1769 static int pass = 0; | 1794 static int pass = 0; |
1770 static int failOk = 0; | 1795 static int failOk = 0; |
1771 static int fail = 0; | 1796 static int fail = 0; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1813 * $pass tests are expected to pass | 1838 * $pass tests are expected to pass |
1814 * $failOk tests are expected to fail that we won't fix | 1839 * $failOk tests are expected to fail that we won't fix |
1815 * $fail tests are expected to fail that we should fix | 1840 * $fail tests are expected to fail that we should fix |
1816 * $crash tests are expected to crash that we should fix | 1841 * $crash tests are expected to crash that we should fix |
1817 * $timeout tests are allowed to timeout | 1842 * $timeout tests are allowed to timeout |
1818 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 1843 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
1819 """; | 1844 """; |
1820 print(report); | 1845 print(report); |
1821 } | 1846 } |
1822 } | 1847 } |
OLD | NEW |