| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 for (var dummy in optionsFromFile["vmOptions"]) { | 323 for (var dummy in optionsFromFile["vmOptions"]) { |
| 324 SummaryReport.add(expectations); | 324 SummaryReport.add(expectations); |
| 325 } | 325 } |
| 326 } | 326 } |
| 327 if (expectations.contains(SKIP)) return; | 327 if (expectations.contains(SKIP)) return; |
| 328 | 328 |
| 329 switch (configuration['component']) { | 329 switch (configuration['component']) { |
| 330 case 'dartium': | 330 case 'dartium': |
| 331 case 'chromium': | 331 case 'chromium': |
| 332 case 'frogium': | 332 case 'frogium': |
| 333 case 'frogsh': |
| 333 case 'legium': | 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 | 342 |
| 342 if (configuration['component'] == 'dartc') { | 343 if (configuration['component'] == 'dartc') { |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 List<String> args = TestUtils.standardOptions(configuration); | 578 List<String> args = TestUtils.standardOptions(configuration); |
| 578 switch (component) { | 579 switch (component) { |
| 579 // TODO(zundel): Remove chromium now that dartc doesn't generate code? | 580 // TODO(zundel): Remove chromium now that dartc doesn't generate code? |
| 580 case 'chromium': | 581 case 'chromium': |
| 581 args.addAll(['--work', dir]); | 582 args.addAll(['--work', dir]); |
| 582 args.addAll(vmOptions); | 583 args.addAll(vmOptions); |
| 583 args.add('--ignore-unrecognized-flags'); | 584 args.add('--ignore-unrecognized-flags'); |
| 584 args.add(inputFile); | 585 args.add(inputFile); |
| 585 // TODO(whesse): Add --fatal-type-errors if needed. | 586 // TODO(whesse): Add --fatal-type-errors if needed. |
| 586 break; | 587 break; |
| 588 case 'frogsh': |
| 589 args.clear(); |
| 590 args.add('--out=$outputFile'); |
| 591 args.add('--frogpad_js=' + |
| 592 '${TestUtils.buildDir(configuration)}/frog/bin/frogpad.js'); |
| 593 args.add(inputFile); |
| 594 break; |
| 587 case 'frogium': | 595 case 'frogium': |
| 588 case 'legium': | 596 case 'legium': |
| 589 case 'webdriver': | 597 case 'webdriver': |
| 590 String libdir = configuration['froglib']; | 598 String libdir = configuration['froglib']; |
| 591 if (libdir == '') { | 599 if (libdir == '') { |
| 592 libdir = '$dartDir/frog/lib'; | 600 libdir = '$dartDir/frog/lib'; |
| 593 } | 601 } |
| 594 args.addAll(['--libdir=$libdir', | 602 args.addAll(['--libdir=$libdir', |
| 595 '--compile-only', | 603 '--compile-only', |
| 596 '--out=$outputFile']); | 604 '--out=$outputFile']); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 return TestUtils.mkdirRecursive(tempDirPath, | 677 return TestUtils.mkdirRecursive(tempDirPath, |
| 670 Strings.join(generatedTestPath, '/')); | 678 Strings.join(generatedTestPath, '/')); |
| 671 } | 679 } |
| 672 | 680 |
| 673 String get scriptType() { | 681 String get scriptType() { |
| 674 switch (configuration['component']) { | 682 switch (configuration['component']) { |
| 675 case 'dartium': | 683 case 'dartium': |
| 676 return 'application/dart'; | 684 return 'application/dart'; |
| 677 case 'chromium': | 685 case 'chromium': |
| 678 case 'frogium': | 686 case 'frogium': |
| 687 case 'frogsh': |
| 679 case 'legium': | 688 case 'legium': |
| 680 case 'webdriver': | 689 case 'webdriver': |
| 681 return 'text/javascript'; | 690 return 'text/javascript'; |
| 682 default: | 691 default: |
| 683 Expect.fail('Unimplemented component scriptType'); | 692 Expect.fail("Unexpected component '{configuration['component']}'"); |
| 684 return null; | 693 return null; |
| 685 } | 694 } |
| 686 } | 695 } |
| 687 | 696 |
| 688 String getHtmlName(String filename) { | 697 String getHtmlName(String filename) { |
| 689 return filename.replaceAll('/', '_').replaceAll(':', '_') | 698 return filename.replaceAll('/', '_').replaceAll(':', '_') |
| 690 + configuration['component'] + '.html'; | 699 + configuration['component'] + '.html'; |
| 691 } | 700 } |
| 692 | 701 |
| 693 String get dumpRenderTreeFilename() { | 702 String get dumpRenderTreeFilename() { |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 throw "Executable '$name' does not exist"; | 1126 throw "Executable '$name' does not exist"; |
| 1118 } | 1127 } |
| 1119 return name; | 1128 return name; |
| 1120 } | 1129 } |
| 1121 | 1130 |
| 1122 static String compilerPath(Map configuration) { | 1131 static String compilerPath(Map configuration) { |
| 1123 if (configuration['component'] == 'dartium') { | 1132 if (configuration['component'] == 'dartium') { |
| 1124 return null; // No separate compiler for dartium tests. | 1133 return null; // No separate compiler for dartium tests. |
| 1125 } | 1134 } |
| 1126 var name = configuration['frog']; | 1135 var name = configuration['frog']; |
| 1136 if (configuration['component'] == 'frogsh') { |
| 1137 name = '${dartDir()}/tools/testing/frogpad/frogpad.py'; |
| 1138 } |
| 1127 if (name == '') { | 1139 if (name == '') { |
| 1128 name = '${buildDir(configuration)}/${compilerName(configuration)}'; | 1140 name = '${buildDir(configuration)}/${compilerName(configuration)}'; |
| 1129 } | 1141 } |
| 1130 if (!(new File(name)).existsSync() && !configuration['list']) { | 1142 if (!(new File(name)).existsSync() && !configuration['list']) { |
| 1131 throw "Executable '$name' does not exist"; | 1143 throw "Executable '$name' does not exist"; |
| 1132 } | 1144 } |
| 1133 return name; | 1145 return name; |
| 1134 } | 1146 } |
| 1135 | 1147 |
| 1136 static String outputDir(Map configuration) { | 1148 static String outputDir(Map configuration) { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 * $noCrash tests are expected to be flaky but not crash | 1228 * $noCrash tests are expected to be flaky but not crash |
| 1217 * $pass tests are expected to pass | 1229 * $pass tests are expected to pass |
| 1218 * $failOk tests are expected to fail that we won't fix | 1230 * $failOk tests are expected to fail that we won't fix |
| 1219 * $fail tests are expected to fail that we should fix | 1231 * $fail tests are expected to fail that we should fix |
| 1220 * $crash tests are expected to crash that we should fix | 1232 * $crash tests are expected to crash that we should fix |
| 1221 * $timeout tests are allowed to timeout | 1233 * $timeout tests are allowed to timeout |
| 1222 """; | 1234 """; |
| 1223 print(report); | 1235 print(report); |
| 1224 } | 1236 } |
| 1225 } | 1237 } |
| OLD | NEW |