| OLD | NEW |
| 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/util/io.dart'; | 10 import 'package:test/src/util/io.dart'; |
| 11 import 'package:test/test.dart'; | 11 import 'package:test/test.dart'; |
| 12 | 12 |
| 13 import '../io.dart'; | 13 import '../io.dart'; |
| 14 | 14 |
| 15 String _sandbox; | 15 String _sandbox; |
| 16 | 16 |
| 17 final _otherOS = Platform.isWindows ? "mac-os" : "windows"; | 17 final _otherOS = Platform.isWindows ? "mac-os" : "windows"; |
| 18 | 18 |
| 19 void main() { | 19 void main() { |
| 20 setUp(() { | 20 setUp(() { |
| 21 _sandbox = Directory.systemTemp.createTempSync('test_').path; | 21 _sandbox = createTempDir(); |
| 22 }); | 22 }); |
| 23 | 23 |
| 24 tearDown(() { | 24 tearDown(() { |
| 25 new Directory(_sandbox).deleteSync(recursive: true); | 25 new Directory(_sandbox).deleteSync(recursive: true); |
| 26 }); | 26 }); |
| 27 | 27 |
| 28 group("for suite", () { | 28 group("for suite", () { |
| 29 test("runs a test suite on a matching platform", () { | 29 test("runs a test suite on a matching platform", () { |
| 30 _writeTestFile("vm_test.dart", suiteTestOn: "vm"); | 30 _writeTestFile("vm_test.dart", suiteTestOn: "vm"); |
| 31 | 31 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 buffer.writeln(" });"); | 208 buffer.writeln(" });"); |
| 209 } | 209 } |
| 210 | 210 |
| 211 buffer.writeln("}"); | 211 buffer.writeln("}"); |
| 212 | 212 |
| 213 new File(p.join(_sandbox, filename)).writeAsStringSync(buffer.toString()); | 213 new File(p.join(_sandbox, filename)).writeAsStringSync(buffer.toString()); |
| 214 } | 214 } |
| 215 | 215 |
| 216 ProcessResult _runUnittest(List<String> args) => | 216 ProcessResult _runUnittest(List<String> args) => |
| 217 runUnittest(args, workingDirectory: _sandbox); | 217 runUnittest(args, workingDirectory: _sandbox); |
| OLD | NEW |