OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'dart:io'; |
| 6 |
| 7 import 'package:path/path.dart' as p; |
| 8 import 'package:unittest/unittest.dart'; |
| 9 |
| 10 import '../../io.dart'; |
| 11 |
| 12 String _sandbox; |
| 13 |
| 14 void main() { |
| 15 setUp(() { |
| 16 _sandbox = Directory.systemTemp.createTempSync('unittest_').path; |
| 17 }); |
| 18 |
| 19 tearDown(() { |
| 20 new Directory(_sandbox).deleteSync(recursive: true); |
| 21 }); |
| 22 |
| 23 test("prints the platform name when running on multiple platforms", () { |
| 24 new File(p.join(_sandbox, "test.dart")).writeAsStringSync(""" |
| 25 import 'dart:async'; |
| 26 |
| 27 import 'package:path/path.dart' as p; |
| 28 import 'package:unittest/unittest.dart'; |
| 29 |
| 30 void main() { |
| 31 test("success", () {}); |
| 32 } |
| 33 """); |
| 34 |
| 35 var result = _runUnittest(["-p", "chrome", "-p", "vm", "test.dart"]); |
| 36 expect(result.stdout, contains("[VM]")); |
| 37 expect(result.stdout, contains("[Chrome]")); |
| 38 expect(result.exitCode, equals(0)); |
| 39 }); |
| 40 } |
| 41 |
| 42 ProcessResult _runUnittest(List<String> args) => |
| 43 runUnittest(args, workingDirectory: _sandbox); |
OLD | NEW |