OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
10 import 'package:scheduled_test/descriptor.dart' as d; | 10 import 'package:scheduled_test/descriptor.dart' as d; |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 void main() { | 225 void main() { |
226 test("success", () => new Future.delayed(Duration.ZERO)); | 226 test("success", () => new Future.delayed(Duration.ZERO)); |
227 } | 227 } |
228 """).create(); | 228 """).create(); |
229 | 229 |
230 var test = runTest(["--timeout=none", "test.dart"]); | 230 var test = runTest(["--timeout=none", "test.dart"]); |
231 test.stdout.expect(consumeThrough(contains("All tests passed!"))); | 231 test.stdout.expect(consumeThrough(contains("All tests passed!"))); |
232 test.shouldExit(0); | 232 test.shouldExit(0); |
233 }); | 233 }); |
| 234 |
| 235 test("uses the specified paths", () { |
| 236 d.file("dart_test.yaml", JSON.encode({ |
| 237 "paths": ["zip", "zap"] |
| 238 })).create(); |
| 239 |
| 240 d.dir("zip", [ |
| 241 d.file("zip_test.dart", """ |
| 242 import 'package:test/test.dart'; |
| 243 |
| 244 void main() { |
| 245 test("success", () {}); |
| 246 } |
| 247 """) |
| 248 ]).create(); |
| 249 |
| 250 d.dir("zap", [ |
| 251 d.file("zip_test.dart", """ |
| 252 import 'package:test/test.dart'; |
| 253 |
| 254 void main() { |
| 255 test("success", () {}); |
| 256 } |
| 257 """) |
| 258 ]).create(); |
| 259 |
| 260 d.dir("zop", [ |
| 261 d.file("zip_test.dart", """ |
| 262 import 'package:test/test.dart'; |
| 263 |
| 264 void main() { |
| 265 test("failure", () => throw "oh no"); |
| 266 } |
| 267 """) |
| 268 ]).create(); |
| 269 |
| 270 var test = runTest([]); |
| 271 test.stdout.expect(consumeThrough(contains('All tests passed!'))); |
| 272 test.shouldExit(0); |
| 273 }); |
| 274 |
| 275 test("uses the specified filename", () { |
| 276 d.file("dart_test.yaml", JSON.encode({ |
| 277 "filename": "test_*.dart" |
| 278 })).create(); |
| 279 |
| 280 d.dir("test", [ |
| 281 d.file("test_foo.dart", """ |
| 282 import 'package:test/test.dart'; |
| 283 |
| 284 void main() { |
| 285 test("success", () {}); |
| 286 } |
| 287 """), |
| 288 |
| 289 d.file("foo_test.dart", """ |
| 290 import 'package:test/test.dart'; |
| 291 |
| 292 void main() { |
| 293 test("failure", () => throw "oh no"); |
| 294 } |
| 295 """), |
| 296 |
| 297 d.file("test_foo.bart", """ |
| 298 import 'package:test/test.dart'; |
| 299 |
| 300 void main() { |
| 301 test("failure", () => throw "oh no"); |
| 302 } |
| 303 """) |
| 304 ]).create(); |
| 305 |
| 306 var test = runTest([]); |
| 307 test.stdout.expect(consumeThrough(contains('All tests passed!'))); |
| 308 test.shouldExit(0); |
| 309 }); |
234 } | 310 } |
OLD | NEW |