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': | |
|
Emily Fortuna
2012/03/06 00:37:52
only if not Windows, right?
| |
| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 // TODO(zundel): remove assumption of generated code from dartc | 585 // TODO(zundel): remove assumption of generated code from dartc |
| 585 args.add('--out'); | 586 args.add('--out'); |
| 586 args.add(outputFile); | 587 args.add(outputFile); |
| 587 args.add(inputFile); | 588 args.add(inputFile); |
| 588 // TODO(whesse): Add --fatal-type-errors if needed. | 589 // TODO(whesse): Add --fatal-type-errors if needed. |
| 589 break; | 590 break; |
| 591 case 'frogsh': | |
|
Emily Fortuna
2012/03/06 00:37:52
if !Windows
| |
| 592 args.clear(); | |
| 593 args.add('--out=$outputFile'); | |
| 594 args.add('--frogpad_js=' + | |
| 595 '${TestUtils.buildDir(configuration)}/frog/bin/frogpad.js'); | |
| 596 args.add(inputFile); | |
| 597 break; | |
| 590 case 'frogium': | 598 case 'frogium': |
| 591 case 'legium': | 599 case 'legium': |
| 592 case 'webdriver': | 600 case 'webdriver': |
| 593 String libdir = configuration['froglib']; | 601 String libdir = configuration['froglib']; |
| 594 if (libdir == '') { | 602 if (libdir == '') { |
| 595 libdir = '$dartDir/frog/lib'; | 603 libdir = '$dartDir/frog/lib'; |
| 596 } | 604 } |
| 597 args.addAll(['--libdir=$libdir', | 605 args.addAll(['--libdir=$libdir', |
| 598 '--compile-only', | 606 '--compile-only', |
| 599 '--out=$outputFile']); | 607 '--out=$outputFile']); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 666 if (!tempDir.existsSync()) { | 674 if (!tempDir.existsSync()) { |
| 667 tempDir.createSync(); | 675 tempDir.createSync(); |
| 668 } | 676 } |
| 669 } | 677 } |
| 670 tempDirPath = new File(tempDirPath).fullPathSync().replaceAll('\\', '/'); | 678 tempDirPath = new File(tempDirPath).fullPathSync().replaceAll('\\', '/'); |
| 671 return TestUtils.mkdirRecursive(tempDirPath, | 679 return TestUtils.mkdirRecursive(tempDirPath, |
| 672 Strings.join(generatedTestPath, '/')); | 680 Strings.join(generatedTestPath, '/')); |
| 673 } | 681 } |
| 674 | 682 |
| 675 String get scriptType() { | 683 String get scriptType() { |
| 676 switch (configuration['component']) { | 684 String component = configuration['component']; |
| 685 switch (component) { | |
| 677 case 'dartium': | 686 case 'dartium': |
| 678 return 'application/dart'; | 687 return 'application/dart'; |
| 679 case 'chromium': | 688 case 'chromium': |
| 680 case 'frogium': | 689 case 'frogium': |
| 690 case 'frogsh': | |
| 681 case 'legium': | 691 case 'legium': |
| 682 case 'webdriver': | 692 case 'webdriver': |
| 683 return 'text/javascript'; | 693 return 'text/javascript'; |
| 684 default: | 694 default: |
| 685 Expect.fail('Unimplemented component scriptType'); | 695 Expect.fail("Unexpected component '$component'"); |
| 686 return null; | 696 return null; |
| 687 } | 697 } |
| 688 } | 698 } |
| 689 | 699 |
| 690 String getHtmlName(String filename) { | 700 String getHtmlName(String filename) { |
| 691 return filename.replaceAll('/', '_').replaceAll(':', '_') | 701 return filename.replaceAll('/', '_').replaceAll(':', '_') |
| 692 + configuration['component'] + '.html'; | 702 + configuration['component'] + '.html'; |
| 693 } | 703 } |
| 694 | 704 |
| 695 String get dumpRenderTreeFilename() { | 705 String get dumpRenderTreeFilename() { |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1105 case 'dartc': | 1115 case 'dartc': |
| 1106 return 'compiler/bin/dartc$suffix'; | 1116 return 'compiler/bin/dartc$suffix'; |
| 1107 case 'frogium': | 1117 case 'frogium': |
| 1108 case 'legium': | 1118 case 'legium': |
| 1109 case 'webdriver': | 1119 case 'webdriver': |
| 1110 return 'frog/bin/frog$suffix'; | 1120 return 'frog/bin/frog$suffix'; |
| 1111 default: | 1121 default: |
| 1112 throw "Unknown compiler for: ${configuration['component']}"; | 1122 throw "Unknown compiler for: ${configuration['component']}"; |
| 1113 } | 1123 } |
| 1114 } | 1124 } |
| 1115 | 1125 |
|
Emily Fortuna
2012/03/06 00:37:52
take out extra whitespace
| |
| 1116 static String dartShellFileName(Map configuration) { | 1126 static String dartShellFileName(Map configuration) { |
| 1117 var name = '${buildDir(configuration)}/${executableName(configuration)}'; | 1127 var name = '${buildDir(configuration)}/${executableName(configuration)}'; |
| 1118 if (!(new File(name)).existsSync() && !configuration['list']) { | 1128 if (!(new File(name)).existsSync() && !configuration['list']) { |
| 1119 throw "Executable '$name' does not exist"; | 1129 throw "Executable '$name' does not exist"; |
| 1120 } | 1130 } |
| 1121 return name; | 1131 return name; |
| 1122 } | 1132 } |
| 1123 | 1133 |
| 1124 static String compilerPath(Map configuration) { | 1134 static String compilerPath(Map configuration) { |
| 1125 if (configuration['component'] == 'dartium') { | 1135 if (configuration['component'] == 'dartium') { |
| 1126 return null; // No separate compiler for dartium tests. | 1136 return null; // No separate compiler for dartium tests. |
| 1127 } | 1137 } |
| 1128 var name = configuration['frog']; | 1138 var name = configuration['frog']; |
| 1129 if (name == '') { | 1139 if (configuration['component'] == 'frogsh') { |
|
Emily Fortuna
2012/03/06 00:37:52
&& os==Windows?
| |
| 1140 name = '${dartDir()}/tools/testing/frogpad/frogpad.py'; | |
| 1141 } | |
| 1142 if (name == '') { | |
|
Emily Fortuna
2012/03/06 00:37:52
extra trailing whitespace
| |
| 1130 name = '${buildDir(configuration)}/${compilerName(configuration)}'; | 1143 name = '${buildDir(configuration)}/${compilerName(configuration)}'; |
| 1131 } | 1144 } |
| 1132 if (!(new File(name)).existsSync() && !configuration['list']) { | 1145 if (!(new File(name)).existsSync() && !configuration['list']) { |
| 1133 throw "Executable '$name' does not exist"; | 1146 throw "Executable '$name' does not exist"; |
| 1134 } | 1147 } |
| 1135 return name; | 1148 return name; |
| 1136 } | 1149 } |
| 1137 | 1150 |
| 1138 static String outputDir(Map configuration) { | 1151 static String outputDir(Map configuration) { |
| 1139 var result = ''; | 1152 var result = ''; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1218 * $noCrash tests are expected to be flaky but not crash | 1231 * $noCrash tests are expected to be flaky but not crash |
| 1219 * $pass tests are expected to pass | 1232 * $pass tests are expected to pass |
| 1220 * $failOk tests are expected to fail that we won't fix | 1233 * $failOk tests are expected to fail that we won't fix |
| 1221 * $fail tests are expected to fail that we should fix | 1234 * $fail tests are expected to fail that we should fix |
| 1222 * $crash tests are expected to crash that we should fix | 1235 * $crash tests are expected to crash that we should fix |
| 1223 * $timeout tests are allowed to timeout | 1236 * $timeout tests are allowed to timeout |
| 1224 """; | 1237 """; |
| 1225 print(report); | 1238 print(report); |
| 1226 } | 1239 } |
| 1227 } | 1240 } |
| OLD | NEW |