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

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

Issue 1056733002: Run test tearDowns and clean up temporary directories when a signal is caught. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes 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/signal_test.dart ('k') | 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 // 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
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);
OLDNEW
« no previous file with comments | « test/runner/signal_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698