Chromium Code Reviews| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 664 if (!tempDir.existsSync()) { | 672 if (!tempDir.existsSync()) { |
| 665 tempDir.createSync(); | 673 tempDir.createSync(); |
| 666 } | 674 } |
| 667 } | 675 } |
| 668 tempDirPath = new File(tempDirPath).fullPathSync().replaceAll('\\', '/'); | 676 tempDirPath = new File(tempDirPath).fullPathSync().replaceAll('\\', '/'); |
| 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 String component = configuration['component']; |
| 683 switch (component) { | |
| 675 case 'dartium': | 684 case 'dartium': |
| 676 return 'application/dart'; | 685 return 'application/dart'; |
| 677 case 'chromium': | 686 case 'chromium': |
| 678 case 'frogium': | 687 case 'frogium': |
| 688 case 'frogsh': | |
| 679 case 'legium': | 689 case 'legium': |
| 680 case 'webdriver': | 690 case 'webdriver': |
| 681 return 'text/javascript'; | 691 return 'text/javascript'; |
| 682 default: | 692 default: |
| 683 Expect.fail('Unimplemented component scriptType'); | 693 Expect.fail("Unexpected component '$component'"); |
|
Bill Hesse
2012/03/08 10:34:27
Why not just write ${configuration['component']} h
mattsh
2012/03/08 16:31:42
Done.
| |
| 684 return null; | 694 return null; |
| 685 } | 695 } |
| 686 } | 696 } |
| 687 | 697 |
| 688 String getHtmlName(String filename) { | 698 String getHtmlName(String filename) { |
| 689 return filename.replaceAll('/', '_').replaceAll(':', '_') | 699 return filename.replaceAll('/', '_').replaceAll(':', '_') |
| 690 + configuration['component'] + '.html'; | 700 + configuration['component'] + '.html'; |
| 691 } | 701 } |
| 692 | 702 |
| 693 String get dumpRenderTreeFilename() { | 703 String get dumpRenderTreeFilename() { |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1103 case 'dartc': | 1113 case 'dartc': |
| 1104 return 'compiler/bin/dartc$suffix'; | 1114 return 'compiler/bin/dartc$suffix'; |
| 1105 case 'frogium': | 1115 case 'frogium': |
| 1106 case 'legium': | 1116 case 'legium': |
| 1107 case 'webdriver': | 1117 case 'webdriver': |
| 1108 return 'frog/bin/frog$suffix'; | 1118 return 'frog/bin/frog$suffix'; |
| 1109 default: | 1119 default: |
| 1110 throw "Unknown compiler for: ${configuration['component']}"; | 1120 throw "Unknown compiler for: ${configuration['component']}"; |
| 1111 } | 1121 } |
| 1112 } | 1122 } |
| 1113 | 1123 |
|
Bill Hesse
2012/03/08 10:34:27
Whitespace.
mattsh
2012/03/08 16:31:42
Done.
| |
| 1114 static String dartShellFileName(Map configuration) { | 1124 static String dartShellFileName(Map configuration) { |
| 1115 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 1125 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
| 1116 if (!(new File(name)).existsSync() && !configuration['list']) { | 1126 if (!(new File(name)).existsSync() && !configuration['list']) { |
| 1117 throw "Executable '$name' does not exist"; | 1127 throw "Executable '$name' does not exist"; |
| 1118 } | 1128 } |
| 1119 return name; | 1129 return name; |
| 1120 } | 1130 } |
| 1121 | 1131 |
| 1122 static String compilerPath(Map configuration) { | 1132 static String compilerPath(Map configuration) { |
| 1123 if (configuration['component'] == 'dartium') { | 1133 if (configuration['component'] == 'dartium') { |
| 1124 return null; // No separate compiler for dartium tests. | 1134 return null; // No separate compiler for dartium tests. |
| 1125 } | 1135 } |
| 1126 var name = configuration['frog']; | 1136 var name = configuration['frog']; |
| 1127 if (name == '') { | 1137 if (configuration['component'] == 'frogsh') { |
| 1138 name = '${dartDir()}/tools/testing/frogpad/frogpad.py'; | |
| 1139 } | |
| 1140 if (name == '') { | |
|
Bill Hesse
2012/03/08 10:34:27
Whitespace.
mattsh
2012/03/08 16:31:42
Done.
| |
| 1128 name = '${buildDir(configuration)}/${compilerName(configuration)}'; | 1141 name = '${buildDir(configuration)}/${compilerName(configuration)}'; |
| 1129 } | 1142 } |
| 1130 if (!(new File(name)).existsSync() && !configuration['list']) { | 1143 if (!(new File(name)).existsSync() && !configuration['list']) { |
| 1131 throw "Executable '$name' does not exist"; | 1144 throw "Executable '$name' does not exist"; |
| 1132 } | 1145 } |
| 1133 return name; | 1146 return name; |
| 1134 } | 1147 } |
| 1135 | 1148 |
| 1136 static String outputDir(Map configuration) { | 1149 static String outputDir(Map configuration) { |
| 1137 var result = ''; | 1150 var result = ''; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1216 * $noCrash tests are expected to be flaky but not crash | 1229 * $noCrash tests are expected to be flaky but not crash |
| 1217 * $pass tests are expected to pass | 1230 * $pass tests are expected to pass |
| 1218 * $failOk tests are expected to fail that we won't fix | 1231 * $failOk tests are expected to fail that we won't fix |
| 1219 * $fail tests are expected to fail that we should fix | 1232 * $fail tests are expected to fail that we should fix |
| 1220 * $crash tests are expected to crash that we should fix | 1233 * $crash tests are expected to crash that we should fix |
| 1221 * $timeout tests are allowed to timeout | 1234 * $timeout tests are allowed to timeout |
| 1222 """; | 1235 """; |
| 1223 print(report); | 1236 print(report); |
| 1224 } | 1237 } |
| 1225 } | 1238 } |
| OLD | NEW |