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

Side by Side Diff: test/runner/browser/compiler_pool_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/browser/compact_reporter_test.dart ('k') | test/runner/browser/loader_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/util/exit_codes.dart' as exit_codes; 10 import 'package:test/src/util/exit_codes.dart' as exit_codes;
11 import 'package:test/src/util/io.dart';
11 import 'package:test/test.dart'; 12 import 'package:test/test.dart';
12 13
13 import '../../io.dart'; 14 import '../../io.dart';
14 15
15 String _sandbox; 16 String _sandbox;
16 17
17 void main() { 18 void main() {
18 setUp(() { 19 setUp(() {
19 _sandbox = Directory.systemTemp.createTempSync('test_').path; 20 _sandbox = createTempDir();
20 }); 21 });
21 22
22 tearDown(() { 23 tearDown(() {
23 new Directory(_sandbox).deleteSync(recursive: true); 24 new Directory(_sandbox).deleteSync(recursive: true);
24 }); 25 });
25 26
26 test("doesn't intermingle warnings", () { 27 test("doesn't intermingle warnings", () {
27 // These files need trailing newlines to work around issue 22667. 28 // These files need trailing newlines to work around issue 22667.
28 var testPath1 = p.join(_sandbox, "test1.dart"); 29 var testPath1 = p.join(_sandbox, "test1.dart");
29 new File(testPath1).writeAsStringSync("String main() => 12;\n"); 30 new File(testPath1).writeAsStringSync("String main() => 12;\n");
(...skipping 22 matching lines...) Expand all
52 new File(testPath).writeAsStringSync("String main() => 12;\n"); 53 new File(testPath).writeAsStringSync("String main() => 12;\n");
53 54
54 var result = _runUnittest(["--color", "-p", "chrome", "test.dart"]); 55 var result = _runUnittest(["--color", "-p", "chrome", "test.dart"]);
55 expect(result.stdout, contains('\u001b[35m')); 56 expect(result.stdout, contains('\u001b[35m'));
56 expect(result.exitCode, equals(exit_codes.data)); 57 expect(result.exitCode, equals(exit_codes.data));
57 }); 58 });
58 } 59 }
59 60
60 ProcessResult _runUnittest(List<String> args) => 61 ProcessResult _runUnittest(List<String> args) =>
61 runUnittest(args, workingDirectory: _sandbox); 62 runUnittest(args, workingDirectory: _sandbox);
OLDNEW
« no previous file with comments | « test/runner/browser/compact_reporter_test.dart ('k') | test/runner/browser/loader_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698