Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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("standalone_test_config"); | 5 #library("standalone_test_config"); |
| 6 | 6 |
| 7 #import("../../tools/testing/dart/test_runner.dart"); | 7 #import("../../tools/testing/dart/test_runner.dart"); |
| 8 #import("../../tools/testing/dart/status_file_parser.dart"); | 8 #import("../../tools/testing/dart/status_file_parser.dart"); |
| 9 | 9 |
| 10 class StandaloneTestSuite { | 10 class StandaloneTestSuite { |
| 11 String directoryPath = "tests/standalone/src"; | 11 String directoryPath = "tests/standalone/src"; |
| 12 final String statusFilePath = "tests/standalone/standalone.status"; | 12 final String statusFilePath = "tests/standalone/standalone.status"; |
| 13 Function doTest; | 13 Function doTest; |
| 14 Function doDone; | 14 Function doDone; |
| 15 String shellPath; | 15 String shellPath; |
| 16 String pathSeparator; | 16 String pathSeparator; |
| 17 Map<String, String> configuration; | 17 Map configuration; |
|
Mads Ager (google)
2011/11/11 11:35:20
Thanks!
| |
| 18 TestExpectationsMap testExpectationsMap; | 18 TestExpectationsMap testExpectationsMap; |
| 19 | 19 |
| 20 StandaloneTestSuite(Map this.configuration) { | 20 StandaloneTestSuite(Map this.configuration) { |
| 21 shellPath = getDartShellFileName(configuration) ; | 21 shellPath = getDartShellFileName(configuration) ; |
| 22 pathSeparator = new Platform().pathSeparator(); | 22 pathSeparator = new Platform().pathSeparator(); |
| 23 } | 23 } |
| 24 | 24 |
| 25 void forEachTest(Function onTest, [Function onDone = null]) { | 25 void forEachTest(Function onTest, [Function onDone = null]) { |
| 26 doTest = onTest; | 26 doTest = onTest; |
| 27 doDone = onDone; | 27 doDone = onDone; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 47 if (!filename.endsWith("Test.dart")) return; | 47 if (!filename.endsWith("Test.dart")) return; |
| 48 | 48 |
| 49 int start = filename.lastIndexOf(pathSeparator); | 49 int start = filename.lastIndexOf(pathSeparator); |
| 50 String testName = filename.substring(start + 1, filename.length - 5); | 50 String testName = filename.substring(start + 1, filename.length - 5); |
| 51 Set<String> expectations = testExpectationsMap.expectations(testName); | 51 Set<String> expectations = testExpectationsMap.expectations(testName); |
| 52 | 52 |
| 53 // TODO(whesse): Skip files with internal directives, and multipart files, | 53 // TODO(whesse): Skip files with internal directives, and multipart files, |
| 54 // until they are handled correctly. | 54 // until they are handled correctly. |
| 55 if (expectations.contains(SKIP)) return; | 55 if (expectations.contains(SKIP)) return; |
| 56 | 56 |
| 57 List args = ["--ignore-unrecognized-flags"]; | |
| 58 if (configuration["checked"]) { | |
| 59 args.add("--enable-type-checks"); | |
| 60 } | |
| 61 args.add(filename); | |
| 57 | 62 |
| 58 doTest(new TestCase(testName, | 63 doTest(new TestCase(testName, |
| 59 shellPath, | 64 shellPath, |
| 60 <String>["--enable_type_checks", | 65 args, |
| 61 "--ignore-unrecognized-flags", | |
| 62 filename ], | |
| 63 completeHandler, | 66 completeHandler, |
| 64 expectations)); | 67 expectations)); |
| 65 } | 68 } |
| 66 | 69 |
| 67 void completeHandler(TestCase testCase) { | 70 void completeHandler(TestCase testCase) { |
| 68 } | 71 } |
| 69 } | 72 } |
| OLD | NEW |