Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: tests/standalone/src/TestRunnerTest.dart

Issue 8493004: Dart test script dart rewrite - find the correct executable file for "process_test". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 #library("TestRunnerTest"); 6 #library("TestRunnerTest");
7 7
8 8
9 #import("../../../tools/testing/dart/test_runner.dart"); 9 #import("../../../tools/testing/dart/test_runner.dart");
10 10
(...skipping 28 matching lines...) Expand all
39 39
40 TestCase MakeTestCase(String testName, List<String> expectations) { 40 TestCase MakeTestCase(String testName, List<String> expectations) {
41 return new TestCase(getDartShellFileName(), <String>[ 41 return new TestCase(getDartShellFileName(), <String>[
42 "--ignore-unrecognized-flags", 42 "--ignore-unrecognized-flags",
43 "--enable_type_checks", 43 "--enable_type_checks",
44 "tests/standalone/src/${testName}.dart"], 44 "tests/standalone/src/${testName}.dart"],
45 TestController.processCompletedTest, 45 TestController.processCompletedTest,
46 new Set<String>.from(expectations)); 46 new Set<String>.from(expectations));
47 } 47 }
48 48
49 String getProcessTestFileName() {
50 var names = ['out/Release_ia32/process_test',
51 'out/Debug_ia32/process_test',
52 'xcodebuild/Release_ia32/process_test',
53 'xcodebuild/Debug_ia32/process_test',
54 'Release_ia32/process_test.exe',
55 'Debug_ia32/process_test.exe'];
56 for (var name in names) {
57 if (new File(name).existsSync()) {
58 return name;
59 }
60 }
61 Expect.fail('Could not find the process_test program.');
62 }
63
49 void main() { 64 void main() {
50 new RunningProcess(MakeTestCase("PassTest", [PASS]), 30).start(); 65 new RunningProcess(MakeTestCase("PassTest", [PASS]), 30).start();
51 new RunningProcess(MakeTestCase("FailTest", [FAIL]), 30).start(); 66 new RunningProcess(MakeTestCase("FailTest", [FAIL]), 30).start();
52 new RunningProcess(MakeTestCase("TimeoutTest", [TIMEOUT]), 30).start(); 67 new RunningProcess(MakeTestCase("TimeoutTest", [TIMEOUT]), 30).start();
53 68
54 // TODO(whesse): Replace process_test with getProcessTestFileName(). 69 new RunningProcess(new TestCase(getProcessTestFileName(),
55 new RunningProcess(new TestCase("out/Debug_ia32/process_test",
56 const ["0", "0", "1", "1"], 70 const ["0", "0", "1", "1"],
57 TestController.processCompletedTest, 71 TestController.processCompletedTest,
58 new Set<String>.from([CRASH])), 72 new Set<String>.from([CRASH])),
59 30).start(); 73 30).start();
60 Expect.equals(4, TestController.numTests); 74 Expect.equals(4, TestController.numTests);
61 // Throw must be from body of start() function for this test to work. 75 // Throw must be from body of start() function for this test to work.
62 Expect.throws( 76 Expect.throws(
63 new RunningProcess(MakeTestCase("PassTest", [SKIP]), 30).start); 77 new RunningProcess(MakeTestCase("PassTest", [SKIP]), 30).start);
64 } 78 }
65 79
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698