| 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("TestRunnerTest"); | 5 #library("TestRunnerTest"); |
| 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 #source("ProcessTestUtil.dart"); | 9 #source("ProcessTestUtil.dart"); |
| 10 | 10 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 } | 36 } |
| 37 | 37 |
| 38 | 38 |
| 39 TestCase MakeTestCase(String testName, List<String> expectations) { | 39 TestCase MakeTestCase(String testName, List<String> expectations) { |
| 40 String test_path = "tests/standalone/src/${testName}.dart"; | 40 String test_path = "tests/standalone/src/${testName}.dart"; |
| 41 // Working directory may be dart/runtime rather than dart. | 41 // Working directory may be dart/runtime rather than dart. |
| 42 if (!new File(test_path).existsSync()) { | 42 if (!new File(test_path).existsSync()) { |
| 43 test_path = "../tests/standalone/src/${testName}.dart"; | 43 test_path = "../tests/standalone/src/${testName}.dart"; |
| 44 } | 44 } |
| 45 | 45 |
| 46 var timeout = 2; | 46 var configuration = { 'timeout': 2, |
| 47 'special-command': '' }; |
| 47 return new TestCase(testName, | 48 return new TestCase(testName, |
| 48 getDartFileName(), | 49 getDartFileName(), |
| 49 <String>["--ignore-unrecognized-flags", | 50 <String>["--ignore-unrecognized-flags", |
| 50 "--enable_type_checks", | 51 "--enable_type_checks", |
| 51 test_path], | 52 test_path], |
| 52 timeout, | 53 configuration, |
| 53 TestController.processCompletedTest, | 54 TestController.processCompletedTest, |
| 54 new Set<String>.from(expectations)); | 55 new Set<String>.from(expectations)); |
| 55 } | 56 } |
| 56 | 57 |
| 57 | 58 |
| 58 void main() { | 59 void main() { |
| 59 int timeout = 2; | 60 var configuration = { 'timeout': 2, |
| 61 'special-command': '' }; |
| 60 new RunningProcess(MakeTestCase("PassTest", [PASS])).start(); | 62 new RunningProcess(MakeTestCase("PassTest", [PASS])).start(); |
| 61 new RunningProcess(MakeTestCase("FailTest", [FAIL])).start(); | 63 new RunningProcess(MakeTestCase("FailTest", [FAIL])).start(); |
| 62 new RunningProcess(MakeTestCase("TimeoutTest", [TIMEOUT])).start(); | 64 new RunningProcess(MakeTestCase("TimeoutTest", [TIMEOUT])).start(); |
| 63 | 65 |
| 64 new RunningProcess(new TestCase("CrashTest", | 66 new RunningProcess(new TestCase("CrashTest", |
| 65 getProcessTestFileName(), | 67 getProcessTestFileName(), |
| 66 const ["0", "0", "1", "1"], | 68 const ["0", "0", "1", "1"], |
| 67 timeout, | 69 configuration, |
| 68 TestController.processCompletedTest, | 70 TestController.processCompletedTest, |
| 69 new Set<String>.from([CRASH]))).start(); | 71 new Set<String>.from([CRASH]))).start(); |
| 70 Expect.equals(4, TestController.numTests); | 72 Expect.equals(4, TestController.numTests); |
| 71 // Throw must be from body of start() function for this test to work. | 73 // Throw must be from body of start() function for this test to work. |
| 72 Expect.throws(new RunningProcess(MakeTestCase("PassTest", [SKIP])).start); | 74 Expect.throws(new RunningProcess(MakeTestCase("PassTest", [SKIP])).start); |
| 73 } | 75 } |
| 74 | 76 |
| OLD | NEW |