| 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, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 for (var dummy in optionsFromFile["vmOptions"]) { | 324 for (var dummy in optionsFromFile["vmOptions"]) { |
| 325 SummaryReport.add(expectations); | 325 SummaryReport.add(expectations); |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 if (expectations.contains(SKIP)) return; | 328 if (expectations.contains(SKIP)) return; |
| 329 | 329 |
| 330 switch (configuration['component']) { | 330 switch (configuration['component']) { |
| 331 case 'dartium': | 331 case 'dartium': |
| 332 case 'chromium': | 332 case 'chromium': |
| 333 case 'frogium': | 333 case 'frogium': |
| 334 case 'legium': |
| 334 case 'webdriver': | 335 case 'webdriver': |
| 335 enqueueBrowserTest(filename, testName, optionsFromFile, | 336 enqueueBrowserTest(filename, testName, optionsFromFile, |
| 336 expectations, isNegative); | 337 expectations, isNegative); |
| 337 break; | 338 break; |
| 338 default: | 339 default: |
| 339 isNegative = isNegative || | 340 isNegative = isNegative || |
| 340 (configuration['checked'] && info.isNegativeIfChecked); | 341 (configuration['checked'] && info.isNegativeIfChecked); |
| 341 bool enableFatalTypeErrors = false; | 342 bool enableFatalTypeErrors = false; |
| 342 | 343 |
| 343 if (configuration['component'] == 'dartc') { | 344 if (configuration['component'] == 'dartc') { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 args.addAll(['--work', dir]); | 585 args.addAll(['--work', dir]); |
| 585 args.addAll(vmOptions); | 586 args.addAll(vmOptions); |
| 586 args.add('--ignore-unrecognized-flags'); | 587 args.add('--ignore-unrecognized-flags'); |
| 587 // TODO(zundel): remove assumption of generated code from dartc | 588 // TODO(zundel): remove assumption of generated code from dartc |
| 588 args.add('--out'); | 589 args.add('--out'); |
| 589 args.add(outputFile); | 590 args.add(outputFile); |
| 590 args.add(inputFile); | 591 args.add(inputFile); |
| 591 // TODO(whesse): Add --fatal-type-errors if needed. | 592 // TODO(whesse): Add --fatal-type-errors if needed. |
| 592 break; | 593 break; |
| 593 case 'frogium': | 594 case 'frogium': |
| 595 case 'legium': |
| 594 case 'webdriver': | 596 case 'webdriver': |
| 595 String libdir = configuration['froglib']; | 597 String libdir = configuration['froglib']; |
| 596 if (libdir == '') { | 598 if (libdir == '') { |
| 597 libdir = '$dartDir/frog/lib'; | 599 libdir = '$dartDir/frog/lib'; |
| 598 } | 600 } |
| 599 args.addAll(['--libdir=$libdir', | 601 args.addAll(['--libdir=$libdir', |
| 600 '--compile-only', | 602 '--compile-only', |
| 601 '--out=$outputFile']); | 603 '--out=$outputFile']); |
| 602 args.addAll(vmOptions); | 604 args.addAll(vmOptions); |
| 603 args.add(inputFile); | 605 args.add(inputFile); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 } | 682 } |
| 681 return tempDir; | 683 return tempDir; |
| 682 } | 684 } |
| 683 | 685 |
| 684 String get scriptType() { | 686 String get scriptType() { |
| 685 switch (configuration['component']) { | 687 switch (configuration['component']) { |
| 686 case 'dartium': | 688 case 'dartium': |
| 687 return 'application/dart'; | 689 return 'application/dart'; |
| 688 case 'chromium': | 690 case 'chromium': |
| 689 case 'frogium': | 691 case 'frogium': |
| 692 case 'legium': |
| 690 case 'webdriver': | 693 case 'webdriver': |
| 691 return 'text/javascript'; | 694 return 'text/javascript'; |
| 692 default: | 695 default: |
| 693 Expect.fail('Unimplemented component scriptType'); | 696 Expect.fail('Unimplemented component scriptType'); |
| 694 return null; | 697 return null; |
| 695 } | 698 } |
| 696 } | 699 } |
| 697 | 700 |
| 698 String getHtmlName(String filename) { | 701 String getHtmlName(String filename) { |
| 699 return filename.replaceAll('/', '_').replaceAll(':', '_') | 702 return filename.replaceAll('/', '_').replaceAll(':', '_') |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1020 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', | 1023 '$dartDir/third_party/hamcrest/v1_3/hamcrest-library-1.3.0RC2.jar', |
| 1021 '$dartDir/third_party/junit/v4_8_2/junit.jar'], | 1024 '$dartDir/third_party/junit/v4_8_2/junit.jar'], |
| 1022 ':'); // Path separator. | 1025 ':'); // Path separator. |
| 1023 } | 1026 } |
| 1024 } | 1027 } |
| 1025 | 1028 |
| 1026 | 1029 |
| 1027 class TestUtils { | 1030 class TestUtils { |
| 1028 static String executableSuffix(String component) { | 1031 static String executableSuffix(String component) { |
| 1029 if (new Platform().operatingSystem() == 'windows') { | 1032 if (new Platform().operatingSystem() == 'windows') { |
| 1030 if (component != 'frogium' && component != 'webdriver') { | 1033 if (component != 'frogium' |
| 1034 && component != 'legium' |
| 1035 && component != 'webdriver') { |
| 1031 return '.exe'; | 1036 return '.exe'; |
| 1032 } else { | 1037 } else { |
| 1033 return '.bat'; | 1038 return '.bat'; |
| 1034 } | 1039 } |
| 1035 } | 1040 } |
| 1036 return ''; | 1041 return ''; |
| 1037 } | 1042 } |
| 1038 | 1043 |
| 1039 static String executableName(Map configuration) { | 1044 static String executableName(Map configuration) { |
| 1040 String suffix = executableSuffix(configuration['component']); | 1045 String suffix = executableSuffix(configuration['component']); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1053 } | 1058 } |
| 1054 } | 1059 } |
| 1055 | 1060 |
| 1056 static String compilerName(Map configuration) { | 1061 static String compilerName(Map configuration) { |
| 1057 String suffix = executableSuffix(configuration['component']); | 1062 String suffix = executableSuffix(configuration['component']); |
| 1058 switch (configuration['component']) { | 1063 switch (configuration['component']) { |
| 1059 case 'chromium': | 1064 case 'chromium': |
| 1060 case 'dartc': | 1065 case 'dartc': |
| 1061 return 'compiler/bin/dartc$suffix'; | 1066 return 'compiler/bin/dartc$suffix'; |
| 1062 case 'frogium': | 1067 case 'frogium': |
| 1068 case 'legium': |
| 1063 case 'webdriver': | 1069 case 'webdriver': |
| 1064 return 'frog/bin/frog$suffix'; | 1070 return 'frog/bin/frog$suffix'; |
| 1065 default: | 1071 default: |
| 1066 throw "Unknown compiler for: ${configuration['component']}"; | 1072 throw "Unknown compiler for: ${configuration['component']}"; |
| 1067 } | 1073 } |
| 1068 } | 1074 } |
| 1069 | 1075 |
| 1070 static String dartShellFileName(Map configuration) { | 1076 static String dartShellFileName(Map configuration) { |
| 1071 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 1077 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
| 1072 if (!(new File(name)).existsSync() && !configuration['list']) { | 1078 if (!(new File(name)).existsSync() && !configuration['list']) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/')); | 1118 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/')); |
| 1113 return new File('$toolsDir/..').fullPathSync().replaceAll('\\', '/'); | 1119 return new File('$toolsDir/..').fullPathSync().replaceAll('\\', '/'); |
| 1114 } | 1120 } |
| 1115 | 1121 |
| 1116 static List<String> standardOptions(Map configuration) { | 1122 static List<String> standardOptions(Map configuration) { |
| 1117 List args = ["--ignore-unrecognized-flags"]; | 1123 List args = ["--ignore-unrecognized-flags"]; |
| 1118 if (configuration["checked"]) { | 1124 if (configuration["checked"]) { |
| 1119 args.add('--enable_asserts'); | 1125 args.add('--enable_asserts'); |
| 1120 args.add("--enable_type_checks"); | 1126 args.add("--enable_type_checks"); |
| 1121 } | 1127 } |
| 1122 if (configuration["component"] == "leg") { | 1128 if (configuration["component"] == "leg" |
| 1129 || configuration["component"] == "legium") { |
| 1123 args.add("--verbose"); | 1130 args.add("--verbose"); |
| 1124 args.add("--leg"); | 1131 args.add("--leg"); |
| 1125 } | 1132 } |
| 1126 return args; | 1133 return args; |
| 1127 } | 1134 } |
| 1128 } | 1135 } |
| 1129 | 1136 |
| 1130 class SummaryReport { | 1137 class SummaryReport { |
| 1131 static int total = 0; | 1138 static int total = 0; |
| 1132 static int skipped = 0; | 1139 static int skipped = 0; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 * $noCrash tests are expected to be flaky but not crash | 1178 * $noCrash tests are expected to be flaky but not crash |
| 1172 * $pass tests are expected to pass | 1179 * $pass tests are expected to pass |
| 1173 * $failOk tests are expected to fail that we won't fix | 1180 * $failOk tests are expected to fail that we won't fix |
| 1174 * $fail tests are expected to fail that we should fix | 1181 * $fail tests are expected to fail that we should fix |
| 1175 * $crash tests are expected to crash that we should fix | 1182 * $crash tests are expected to crash that we should fix |
| 1176 * $timeout tests are allowed to timeout | 1183 * $timeout tests are allowed to timeout |
| 1177 """; | 1184 """; |
| 1178 print(report); | 1185 print(report); |
| 1179 } | 1186 } |
| 1180 } | 1187 } |
| OLD | NEW |