| 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 #library("test_suite"); | 5 #library("test_suite"); |
| 6 | 6 |
| 7 #import("dart:io"); | 7 #import("dart:io"); |
| 8 #import("status_file_parser.dart"); | 8 #import("status_file_parser.dart"); |
| 9 #import("test_runner.dart"); | 9 #import("test_runner.dart"); |
| 10 #import("multitest.dart"); | 10 #import("multitest.dart"); |
| 11 | 11 |
| 12 #source("browser_test.dart"); | 12 #source("browser_test.dart"); |
| 13 | 13 |
| 14 /** |
| 15 * Classes and methods for enumerating and preparing tests. |
| 16 * |
| 17 * This library includes: |
| 18 * |
| 19 * - Creating tests by listing all the Dart files in certain directories, |
| 20 * and creating [TestCase]s for those files that meet the relevant criteria. |
| 21 * - Preparing tests, including copying files and frameworks to temporary |
| 22 * directories, and computing the command line and arguments to be run. |
| 23 */ |
| 24 |
| 25 /** |
| 26 * A TestSuite represents a collection of tests. It creates a [TestCase] |
| 27 * object for each test to be run, and passes the test cases to a callback. |
| 28 * |
| 29 * Most TestSuites represent a directory or directory tree containing tests, |
| 30 * and a status file containing the expected results when these tests are run. |
| 31 */ |
| 14 interface TestSuite { | 32 interface TestSuite { |
| 33 /** |
| 34 * Call the callback function onTest with a [TestCase] argument for each |
| 35 * test in the suite. When all tests have been processed, call [onDone]. |
| 36 * |
| 37 * The [testCache] argument provides a persistent store that can be used to |
| 38 * cache information about the test suite, so that directories do not need |
| 39 * to be listed each time. If the tests require a temporary directory for |
| 40 * their files, they can get one from [globalTempDir]. |
| 41 */ |
| 15 void forEachTest(Function onTest, Map testCache, String globalTempDir(), | 42 void forEachTest(Function onTest, Map testCache, String globalTempDir(), |
| 16 [Function onDone]); | 43 [Function onDone]); |
| 17 } | 44 } |
| 18 | 45 |
| 19 | |
| 20 class CCTestListerIsolate extends Isolate { | 46 class CCTestListerIsolate extends Isolate { |
| 21 CCTestListerIsolate() : super.heavy(); | 47 CCTestListerIsolate() : super.heavy(); |
| 22 | 48 |
| 23 void main() { | 49 void main() { |
| 24 port.receive((String runnerPath, SendPort replyTo) { | 50 port.receive((String runnerPath, SendPort replyTo) { |
| 25 var p = new Process.start(runnerPath, ["--list"]); | 51 var p = new Process.start(runnerPath, ["--list"]); |
| 26 StringInputStream stdoutStream = new StringInputStream(p.stdout); | 52 StringInputStream stdoutStream = new StringInputStream(p.stdout); |
| 27 List<String> tests = new List<String>(); | 53 List<String> tests = new List<String>(); |
| 28 stdoutStream.lineHandler = () { | 54 stdoutStream.lineHandler = () { |
| 29 String line = stdoutStream.readLine(); | 55 String line = stdoutStream.readLine(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 45 replyTo.send(test); | 71 replyTo.send(test); |
| 46 } | 72 } |
| 47 replyTo.send(""); | 73 replyTo.send(""); |
| 48 }; | 74 }; |
| 49 port.close(); | 75 port.close(); |
| 50 }); | 76 }); |
| 51 } | 77 } |
| 52 } | 78 } |
| 53 | 79 |
| 54 | 80 |
| 81 /** |
| 82 * A specialized [TestSuite] that runs tests written in C to unit test |
| 83 * the Dart virtual machine and its API. |
| 84 * |
| 85 * The tests are compiled into a monolithic executable by the build step. |
| 86 * The executable lists its tests when run with the --list command line flag. |
| 87 * Individual tests are run by specifying them on the command line. |
| 88 */ |
| 55 class CCTestSuite implements TestSuite { | 89 class CCTestSuite implements TestSuite { |
| 56 Map configuration; | 90 Map configuration; |
| 57 final String suiteName; | 91 final String suiteName; |
| 58 String runnerPath; | 92 String runnerPath; |
| 59 final String dartDir; | 93 final String dartDir; |
| 60 List<String> statusFilePaths; | 94 List<String> statusFilePaths; |
| 61 Function doTest; | 95 Function doTest; |
| 62 Function doDone; | 96 Function doDone; |
| 63 ReceivePort receiveTestName; | 97 ReceivePort receiveTestName; |
| 64 TestExpectations testExpectations; | 98 TestExpectations testExpectations; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 Map optionsFromFile; | 175 Map optionsFromFile; |
| 142 bool isNegative; | 176 bool isNegative; |
| 143 bool isNegativeIfChecked; | 177 bool isNegativeIfChecked; |
| 144 bool hasFatalTypeErrors; | 178 bool hasFatalTypeErrors; |
| 145 | 179 |
| 146 TestInformation(this.filename, this.optionsFromFile, this.isNegative, | 180 TestInformation(this.filename, this.optionsFromFile, this.isNegative, |
| 147 this.isNegativeIfChecked, this.hasFatalTypeErrors); | 181 this.isNegativeIfChecked, this.hasFatalTypeErrors); |
| 148 } | 182 } |
| 149 | 183 |
| 150 | 184 |
| 185 /** |
| 186 * A standard [TestSuite] implementation that searches for tests in a |
| 187 * directory, and creates [TestCase]s that compile and/or run them. |
| 188 */ |
| 151 class StandardTestSuite implements TestSuite { | 189 class StandardTestSuite implements TestSuite { |
| 152 Map configuration; | 190 Map configuration; |
| 153 String suiteName; | 191 String suiteName; |
| 154 String directoryPath; | 192 String directoryPath; |
| 155 List<String> statusFilePaths; | 193 List<String> statusFilePaths; |
| 156 Function doTest; | 194 Function doTest; |
| 157 Function doDone; | 195 Function doDone; |
| 158 int activeTestGenerators = 0; | 196 int activeTestGenerators = 0; |
| 159 bool listingDone = false; | 197 bool listingDone = false; |
| 160 TestExpectations testExpectations; | 198 TestExpectations testExpectations; |
| 161 List<TestInformation> cachedTests; | 199 List<TestInformation> cachedTests; |
| 162 final String dartDir; | 200 final String dartDir; |
| 163 Function globalTemporaryDirectory; | 201 Function globalTemporaryDirectory; |
| 164 | 202 |
| 165 StandardTestSuite(Map this.configuration, | 203 StandardTestSuite(Map this.configuration, |
| 166 String this.suiteName, | 204 String this.suiteName, |
| 167 String this.directoryPath, | 205 String this.directoryPath, |
| 168 List<String> this.statusFilePaths) | 206 List<String> this.statusFilePaths) |
| 169 : dartDir = TestUtils.dartDir(); | 207 : dartDir = TestUtils.dartDir(); |
| 170 | 208 |
| 209 /** |
| 210 * The default implementation assumes a file is a test if |
| 211 * it ends in "Test.dart". |
| 212 */ |
| 171 bool isTestFile(String filename) => filename.endsWith("Test.dart"); | 213 bool isTestFile(String filename) => filename.endsWith("Test.dart"); |
| 172 | 214 |
| 173 bool listRecursively() => false; | 215 bool listRecursively() => false; |
| 174 | 216 |
| 175 String shellPath() => TestUtils.dartShellFileName(configuration); | 217 String shellPath() => TestUtils.dartShellFileName(configuration); |
| 176 | 218 |
| 177 List<String> additionalOptions(String filename) => []; | 219 List<String> additionalOptions(String filename) => []; |
| 178 | 220 |
| 179 void forEachTest(Function onTest, Map testCache, String globalTempDir(), | 221 void forEachTest(Function onTest, Map testCache, String globalTempDir(), |
| 180 [Function onDone = null]) { | 222 [Function onDone = null]) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 void processDirectory() { | 260 void processDirectory() { |
| 219 directoryPath = '$dartDir/$directoryPath'; | 261 directoryPath = '$dartDir/$directoryPath'; |
| 220 Directory dir = new Directory(directoryPath); | 262 Directory dir = new Directory(directoryPath); |
| 221 dir.errorHandler = (s) { | 263 dir.errorHandler = (s) { |
| 222 throw s; | 264 throw s; |
| 223 }; | 265 }; |
| 224 dir.existsHandler = (bool exists) { | 266 dir.existsHandler = (bool exists) { |
| 225 if (!exists) { | 267 if (!exists) { |
| 226 print('Directory containing tests not found: $directoryPath'); | 268 print('Directory containing tests not found: $directoryPath'); |
| 227 directoryListingDone(false); | 269 directoryListingDone(false); |
| 228 } else { | 270 } else { |
| 229 dir.fileHandler = processFile; | 271 dir.fileHandler = processFile; |
| 230 dir.doneHandler = directoryListingDone; | 272 dir.doneHandler = directoryListingDone; |
| 231 dir.list(recursive: listRecursively()); | 273 dir.list(recursive: listRecursively()); |
| 232 } | 274 } |
| 233 }; | 275 }; |
| 234 dir.exists(); | 276 dir.exists(); |
| 235 } | 277 } |
| 236 | 278 |
| 237 void enqueueTestCaseFromTestInformation(TestInformation info) { | 279 void enqueueTestCaseFromTestInformation(TestInformation info) { |
| 238 var filename = info.filename; | 280 var filename = info.filename; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 253 int middle = filename.lastIndexOf('_'); | 295 int middle = filename.lastIndexOf('_'); |
| 254 testName = filename.substring(start + 1, middle) + '/' + | 296 testName = filename.substring(start + 1, middle) + '/' + |
| 255 filename.substring(middle + 1, filename.length - 5); | 297 filename.substring(middle + 1, filename.length - 5); |
| 256 } else { | 298 } else { |
| 257 // This case is hit by the dartc client compilation | 299 // This case is hit by the dartc client compilation |
| 258 // tests. These tests are pretty broken compared to the | 300 // tests. These tests are pretty broken compared to the |
| 259 // rest. They use the .dart suffix in the status files. They | 301 // rest. They use the .dart suffix in the status files. They |
| 260 // find tests in weird ways (testing that they contain "#"). | 302 // find tests in weird ways (testing that they contain "#"). |
| 261 // They need to be redone. | 303 // They need to be redone. |
| 262 // TODO(1058): This does not work on Windows. | 304 // TODO(1058): This does not work on Windows. |
| 263 start = filename.indexOf(directoryPath); | 305 start = filename.indexOf(directoryPath); |
| 264 if (start != -1) { | 306 if (start != -1) { |
| 265 testName = filename.substring(start + directoryPath.length + 1); | 307 testName = filename.substring(start + directoryPath.length + 1); |
| 266 } else { | 308 } else { |
| 267 testName = filename; | 309 testName = filename; |
| 268 } | 310 } |
| 269 | 311 |
| 270 if (configuration['component'] != 'dartc') { | 312 if (configuration['component'] != 'dartc') { |
| 271 if (testName.endsWith('.dart')) { | 313 if (testName.endsWith('.dart')) { |
| 272 testName = testName.substring(0, testName.length - 5); | 314 testName = testName.substring(0, testName.length - 5); |
| 273 } | 315 } |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 DoMultitest(filename, | 389 DoMultitest(filename, |
| 348 TestUtils.buildDir(configuration), | 390 TestUtils.buildDir(configuration), |
| 349 directoryPath, | 391 directoryPath, |
| 350 createTestCase, | 392 createTestCase, |
| 351 testGeneratorDone); | 393 testGeneratorDone); |
| 352 } else { | 394 } else { |
| 353 createTestCase(filename, optionsFromFile['isNegative']); | 395 createTestCase(filename, optionsFromFile['isNegative']); |
| 354 } | 396 } |
| 355 } | 397 } |
| 356 | 398 |
| 399 /** |
| 400 * The [StandardTestSuite] has support for testing components that |
| 401 * compile a test from Dart to Javascript, and then run the resulting |
| 402 * Javascript. This function creates a working directory to hold the |
| 403 * Javascript version of the test, and copies the appropriate framework |
| 404 * files to that directory. It creates a [BrowserTestCase], which has |
| 405 * two sequential steps to be run by the [ProcessQueue when] the test is |
| 406 * executed: a compilation |
| 407 * step and an execution step, both with the appropriate executable and |
| 408 * arguments. |
| 409 */ |
| 357 void enqueueBrowserTest(String filename, | 410 void enqueueBrowserTest(String filename, |
| 358 String testName, | 411 String testName, |
| 359 Map optionsFromFile, | 412 Map optionsFromFile, |
| 360 Set<String> expectations, | 413 Set<String> expectations, |
| 361 bool isNegative) { | 414 bool isNegative) { |
| 362 if (optionsFromFile['isMultitest']) return; | 415 if (optionsFromFile['isMultitest']) return; |
| 363 bool isWebTest = optionsFromFile['containsDomImport']; | 416 bool isWebTest = optionsFromFile['containsDomImport']; |
| 364 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition']; | 417 bool isLibraryDefinition = optionsFromFile['isLibraryDefinition']; |
| 365 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) { | 418 if (!isLibraryDefinition && optionsFromFile['containsSourceOrImport']) { |
| 366 print('Warning for $filename: Browser tests require #library ' + | 419 print('Warning for $filename: Browser tests require #library ' + |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 domLibraryImport, | 462 domLibraryImport, |
| 410 '$dartDir/tests/isolate/src/TestFramework.dart', | 463 '$dartDir/tests/isolate/src/TestFramework.dart', |
| 411 dartLibraryFilename)); | 464 dartLibraryFilename)); |
| 412 dartWrapper.closeSync(); | 465 dartWrapper.closeSync(); |
| 413 } else { | 466 } else { |
| 414 dartWrapperFilename = testPath; | 467 dartWrapperFilename = testPath; |
| 415 // TODO(whesse): Once test.py is retired, adjust the relative path in | 468 // TODO(whesse): Once test.py is retired, adjust the relative path in |
| 416 // the client/samples/dartcombat test to its css file, remove the | 469 // the client/samples/dartcombat test to its css file, remove the |
| 417 // "../../" from this path, and move this out of the isWebTest guard. | 470 // "../../" from this path, and move this out of the isWebTest guard. |
| 418 // Also remove getHtmlName, and just use test.html. | 471 // Also remove getHtmlName, and just use test.html. |
| 419 // TODO(efortuna): this shortening of htmlFilename is a band-aid until | 472 // TODO(efortuna): this shortening of htmlFilename is a band-aid until |
| 420 // the above TODO gets fixed. Windows cannot have paths that are longer | 473 // the above TODO gets fixed. Windows cannot have paths that are longer |
| 421 // than 260 characters, and without this hack, we were running past the | 474 // than 260 characters, and without this hack, we were running past the |
| 422 // the limit. | 475 // the limit. |
| 423 String htmlFilename = getHtmlName(filename); | 476 String htmlFilename = getHtmlName(filename); |
| 424 while ('${tempDir.path}/../../$htmlFilename'.length >= 260) { | 477 while ('${tempDir.path}/../../$htmlFilename'.length >= 260) { |
| 425 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); | 478 htmlFilename = htmlFilename.substring(htmlFilename.length~/2); |
| 426 } | 479 } |
| 427 htmlPath = '${tempDir.path}/../../$htmlFilename'; | 480 htmlPath = '${tempDir.path}/../../$htmlFilename'; |
| 428 } | 481 } |
| 429 final String scriptPath = (component == 'dartium') ? | 482 final String scriptPath = (component == 'dartium') ? |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 // No compilation phase. | 526 // No compilation phase. |
| 474 compilerExecutable = null; | 527 compilerExecutable = null; |
| 475 compilerArgs = null; | 528 compilerArgs = null; |
| 476 break; | 529 break; |
| 477 default: | 530 default: |
| 478 Expect.fail('unimplemented component $component'); | 531 Expect.fail('unimplemented component $component'); |
| 479 } | 532 } |
| 480 | 533 |
| 481 List<String> args; | 534 List<String> args; |
| 482 if (component == 'webdriver') { | 535 if (component == 'webdriver') { |
| 483 args = ['$dartDir/tools/testing/run_selenium.py', '--out=$htmlPath', | 536 args = ['$dartDir/tools/testing/run_selenium.py', '--out=$htmlPath', |
| 484 '--browser=${configuration["browser"]}']; | 537 '--browser=${configuration["browser"]}']; |
| 485 } else { | 538 } else { |
| 486 args = [ | 539 args = [ |
| 487 '$dartDir/tools/testing/drt-trampoline.py', | 540 '$dartDir/tools/testing/drt-trampoline.py', |
| 488 dumpRenderTreeFilename, | 541 dumpRenderTreeFilename, |
| 489 '--no-timeout' | 542 '--no-timeout' |
| 490 ]; | 543 ]; |
| 491 if (component == 'dartium') { | 544 if (component == 'dartium') { |
| 492 var dartFlags = ['--ignore-unrecognized-flags']; | 545 var dartFlags = ['--ignore-unrecognized-flags']; |
| 493 if (configuration["checked"]) { | 546 if (configuration["checked"]) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 512 optionsFromFile['isNegative']); | 565 optionsFromFile['isNegative']); |
| 513 doTest(testCase); | 566 doTest(testCase); |
| 514 } | 567 } |
| 515 } | 568 } |
| 516 | 569 |
| 517 bool get requiresCleanTemporaryDirectory() => | 570 bool get requiresCleanTemporaryDirectory() => |
| 518 configuration['component'] == 'dartc' || | 571 configuration['component'] == 'dartc' || |
| 519 configuration['component'] == 'chromium'; | 572 configuration['component'] == 'chromium'; |
| 520 | 573 |
| 521 /** | 574 /** |
| 522 * Create a directory for the generated test. Drop the path to the | 575 * Create a directory for the generated test. If a Dart language test |
| 523 * dart checkout and the final ".dart" from the test path, and replace | 576 * needs to be run in a browser, the Dart test needs to be embedded in |
| 524 * all path separators with underscores. | 577 * an HTML page, with a testing framework based on scripting and DOM events. |
| 578 * These scripts and pages are written to a generated_test directory, |
| 579 * usually inside the build directory of the checkout. |
| 580 * |
| 581 * Some tests, such as those using the dartc compiler, need to be run |
| 582 * with an empty directory as the compiler's work directory. These |
| 583 * tests are copied to a subdirectory of a system-provided temporary |
| 584 * directory, which is deleted at the end of the test run unless the |
| 585 * --keep-temporary-files flag is given. |
| 586 * |
| 587 * Those tests which are already HTML web applications (web tests), with |
| 588 * resources including CSS files and HTML files, need to be compiled into |
| 589 * a work directory where the relative URLS to the resources work. |
| 590 * We use a subdirectory of the build directory that is the same number |
| 591 * of levels down in the checkout as the original path of the web test. |
| 525 */ | 592 */ |
| 526 Directory createOutputDirectory(String testPath, String optionsName) { | 593 Directory createOutputDirectory(String testPath, String optionsName) { |
| 527 String testUniqueName = | 594 String testUniqueName = |
| 528 testPath.substring(dartDir.length + 1, testPath.length - 5); | 595 testPath.substring(dartDir.length + 1, testPath.length - 5); |
| 529 testUniqueName = testUniqueName.replaceAll('/', '_'); | 596 testUniqueName = testUniqueName.replaceAll('/', '_'); |
| 530 testUniqueName += '-$optionsName'; | 597 testUniqueName += '-$optionsName'; |
| 531 | 598 |
| 532 // Create '[build dir]/generated_tests/$component/$testUniqueName', | 599 // Create '[build dir]/generated_tests/$component/$testUniqueName', |
| 533 // including any intermediate directories that don't exist. | 600 // including any intermediate directories that don't exist. |
| 534 String debugMode = | 601 String debugMode = |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 case 'frogium': | 648 case 'frogium': |
| 582 case 'webdriver': | 649 case 'webdriver': |
| 583 return 'text/javascript'; | 650 return 'text/javascript'; |
| 584 default: | 651 default: |
| 585 Expect.fail('Unimplemented component scriptType'); | 652 Expect.fail('Unimplemented component scriptType'); |
| 586 return null; | 653 return null; |
| 587 } | 654 } |
| 588 } | 655 } |
| 589 | 656 |
| 590 String getHtmlName(String filename) { | 657 String getHtmlName(String filename) { |
| 591 return filename.replaceAll('/', '_').replaceAll(':', '_') | 658 return filename.replaceAll('/', '_').replaceAll(':', '_') |
| 592 + configuration['component'] + '.html'; | 659 + configuration['component'] + '.html'; |
| 593 } | 660 } |
| 594 | 661 |
| 595 String get dumpRenderTreeFilename() { | 662 String get dumpRenderTreeFilename() { |
| 596 if (configuration['drt'] != '') { | 663 if (configuration['drt'] != '') { |
| 597 return configuration['drt']; | 664 return configuration['drt']; |
| 598 } | 665 } |
| 599 if (new Platform().operatingSystem() == 'macos') { | 666 if (new Platform().operatingSystem() == 'macos') { |
| 600 return '$dartDir/client/tests/drt/DumpRenderTree.app/Contents/' + | 667 return '$dartDir/client/tests/drt/DumpRenderTree.app/Contents/' + |
| 601 'MacOS/DumpRenderTree'; | 668 'MacOS/DumpRenderTree'; |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 directoryListingDone(true); | 824 directoryListingDone(true); |
| 758 } | 825 } |
| 759 } | 826 } |
| 760 | 827 |
| 761 String shellPath() => TestUtils.compilerPath(configuration); | 828 String shellPath() => TestUtils.compilerPath(configuration); |
| 762 | 829 |
| 763 List<String> additionalOptions(String filename) { | 830 List<String> additionalOptions(String filename) { |
| 764 filename = new File(filename).fullPathSync().replaceAll('\\', '/'); | 831 filename = new File(filename).fullPathSync().replaceAll('\\', '/'); |
| 765 Directory tempDir = createOutputDirectory(filename, 'dartc-test'); | 832 Directory tempDir = createOutputDirectory(filename, 'dartc-test'); |
| 766 return | 833 return |
| 767 [ '--fatal-warnings', '--fatal-type-errors', | 834 [ '--fatal-warnings', '--fatal-type-errors', |
| 768 '-check-only', '-out', tempDir.path]; | 835 '-check-only', '-out', tempDir.path]; |
| 769 } | 836 } |
| 770 | 837 |
| 771 void processDirectory() { | 838 void processDirectory() { |
| 772 directoryPath = '$dartDir/$directoryPath'; | 839 directoryPath = '$dartDir/$directoryPath'; |
| 773 // Enqueueing the directory listers is an activity. | 840 // Enqueueing the directory listers is an activity. |
| 774 activityStarted(); | 841 activityStarted(); |
| 775 for (String testDir in _testDirs) { | 842 for (String testDir in _testDirs) { |
| 776 Directory dir = new Directory("$directoryPath/$testDir"); | 843 Directory dir = new Directory("$directoryPath/$testDir"); |
| 777 if (dir.existsSync()) { | 844 if (dir.existsSync()) { |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 static String buildDir(Map configuration) { | 1055 static String buildDir(Map configuration) { |
| 989 var buildDir = outputDir(configuration); | 1056 var buildDir = outputDir(configuration); |
| 990 buildDir += (configuration['mode'] == 'debug') ? 'Debug_' : 'Release_'; | 1057 buildDir += (configuration['mode'] == 'debug') ? 'Debug_' : 'Release_'; |
| 991 buildDir += configuration['arch']; | 1058 buildDir += configuration['arch']; |
| 992 return buildDir; | 1059 return buildDir; |
| 993 } | 1060 } |
| 994 | 1061 |
| 995 static String dartDir() { | 1062 static String dartDir() { |
| 996 String scriptPath = new Options().script.replaceAll('\\', '/'); | 1063 String scriptPath = new Options().script.replaceAll('\\', '/'); |
| 997 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/')); | 1064 String toolsDir = scriptPath.substring(0, scriptPath.lastIndexOf('/')); |
| 998 return new File('$toolsDir/..').fullPathSync().replaceAll('\\', '/'); | 1065 return new File('$toolsDir/..').fullPathSync().replaceAll('\\', '/'); |
| 999 } | 1066 } |
| 1000 | 1067 |
| 1001 static List<String> standardOptions(Map configuration) { | 1068 static List<String> standardOptions(Map configuration) { |
| 1002 List args = ["--ignore-unrecognized-flags"]; | 1069 List args = ["--ignore-unrecognized-flags"]; |
| 1003 if (configuration["checked"]) { | 1070 if (configuration["checked"]) { |
| 1004 args.add('--enable_asserts'); | 1071 args.add('--enable_asserts'); |
| 1005 args.add("--enable_type_checks"); | 1072 args.add("--enable_type_checks"); |
| 1006 } | 1073 } |
| 1007 if (configuration["component"] == "leg") { | 1074 if (configuration["component"] == "leg") { |
| 1008 args.add("--verbose"); | 1075 args.add("--verbose"); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 * $noCrash tests are expected to be flaky but not crash | 1123 * $noCrash tests are expected to be flaky but not crash |
| 1057 * $pass tests are expected to pass | 1124 * $pass tests are expected to pass |
| 1058 * $failOk tests are expected to fail that we won't fix | 1125 * $failOk tests are expected to fail that we won't fix |
| 1059 * $fail tests are expected to fail that we should fix | 1126 * $fail tests are expected to fail that we should fix |
| 1060 * $crash tests are expected to crash that we should fix | 1127 * $crash tests are expected to crash that we should fix |
| 1061 * $timeout tests are allowed to timeout | 1128 * $timeout tests are allowed to timeout |
| 1062 """; | 1129 """; |
| 1063 print(report); | 1130 print(report); |
| 1064 } | 1131 } |
| 1065 } | 1132 } |
| OLD | NEW |