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

Side by Side Diff: test/runner/loader_test.dart

Issue 1101773002: Add Windows support. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Unused import Created 5 years, 8 months 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
« no previous file with comments | « test/runner/browser/safari_test.dart ('k') | test/runner/pub_serve_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:path/path.dart' as p; 9 import 'package:path/path.dart' as p;
10 import 'package:test/src/backend/state.dart'; 10 import 'package:test/src/backend/state.dart';
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 test("can load and run a failing test", () { 84 test("can load and run a failing test", () {
85 var liveTest = suite.tests[1].load(suite); 85 var liveTest = suite.tests[1].load(suite);
86 expectSingleFailure(liveTest); 86 expectSingleFailure(liveTest);
87 return liveTest.run().whenComplete(() => liveTest.close()); 87 return liveTest.run().whenComplete(() => liveTest.close());
88 }); 88 });
89 89
90 test("throws a nice error if the package root doesn't exist", () { 90 test("throws a nice error if the package root doesn't exist", () {
91 expect(() => new Loader([TestPlatform.chrome], root: _sandbox), 91 expect(() => new Loader([TestPlatform.chrome], root: _sandbox),
92 throwsA(isApplicationException( 92 throwsA(isApplicationException(
93 "Directory ${p.join(_sandbox, 'packages')} does not exist."))); 93 "Directory ${p.prettyUri(p.toUri(p.join(_sandbox, 'packages')))} "
94 "does not exist.")));
94 }); 95 });
95 }); 96 });
96 97
97 group(".loadDir()", () { 98 group(".loadDir()", () {
98 test("ignores non-Dart files", () { 99 test("ignores non-Dart files", () {
99 new File(p.join(_sandbox, 'a_test.txt')).writeAsStringSync(_tests); 100 new File(p.join(_sandbox, 'a_test.txt')).writeAsStringSync(_tests);
100 expect(_loader.loadDir(_sandbox).toList(), completion(isEmpty)); 101 expect(_loader.loadDir(_sandbox).toList(), completion(isEmpty));
101 }); 102 });
102 103
103 test("ignores files in packages/ directories", () { 104 test("ignores files in packages/ directories", () {
(...skipping 21 matching lines...) Expand all
125 .writeAsStringSync(_tests); 126 .writeAsStringSync(_tests);
126 127
127 return _loader.loadDir(_sandbox).toList() 128 return _loader.loadDir(_sandbox).toList()
128 .then((suites_) => suites = suites_); 129 .then((suites_) => suites = suites_);
129 }); 130 });
130 131
131 test("gives those suites the correct paths", () { 132 test("gives those suites the correct paths", () {
132 expect(suites.map((suite) => suite.path), unorderedEquals([ 133 expect(suites.map((suite) => suite.path), unorderedEquals([
133 p.join(_sandbox, 'a_test.dart'), 134 p.join(_sandbox, 'a_test.dart'),
134 p.join(_sandbox, 'another_test.dart'), 135 p.join(_sandbox, 'another_test.dart'),
135 p.join(_sandbox, 'dir/sub_test.dart') 136 p.join(_sandbox, 'dir', 'sub_test.dart')
136 ])); 137 ]));
137 }); 138 });
138 139
139 test("can run tests in those suites", () { 140 test("can run tests in those suites", () {
140 var suite = suites.firstWhere((suite) => suite.path.contains("a_test")); 141 var suite = suites.firstWhere((suite) => suite.path.contains("a_test"));
141 var liveTest = suite.tests[1].load(suite); 142 var liveTest = suite.tests[1].load(suite);
142 expectSingleFailure(liveTest); 143 expectSingleFailure(liveTest);
143 return liveTest.run().whenComplete(() => liveTest.close()); 144 return liveTest.run().whenComplete(() => liveTest.close());
144 }); 145 });
145 }); 146 });
146 }); 147 });
147 } 148 }
OLDNEW
« no previous file with comments | « test/runner/browser/safari_test.dart ('k') | test/runner/pub_serve_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698