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

Side by Side Diff: test/runner/runner_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/parse_metadata_test.dart ('k') | test/runner/signal_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 final _success = """ 18 final _success = """
18 import 'dart:async'; 19 import 'dart:async';
19 20
20 import 'package:test/test.dart'; 21 import 'package:test/test.dart';
(...skipping 23 matching lines...) Expand all
44 -N, --plain-name A plain-text substring of the name of the test to run. 45 -N, --plain-name A plain-text substring of the name of the test to run.
45 -p, --platform The platform(s) on which to run the tests. 46 -p, --platform The platform(s) on which to run the tests.
46 [vm (default), chrome] 47 [vm (default), chrome]
47 48
48 --[no-]color Whether to use terminal colors. 49 --[no-]color Whether to use terminal colors.
49 (auto-detected by default) 50 (auto-detected by default)
50 """; 51 """;
51 52
52 void main() { 53 void main() {
53 setUp(() { 54 setUp(() {
54 _sandbox = Directory.systemTemp.createTempSync('test_').path; 55 _sandbox = createTempDir();
55 }); 56 });
56 57
57 tearDown(() { 58 tearDown(() {
58 new Directory(_sandbox).deleteSync(recursive: true); 59 new Directory(_sandbox).deleteSync(recursive: true);
59 }); 60 });
60 61
61 test("prints help information", () { 62 test("prints help information", () {
62 var result = _runUnittest(["--help"]); 63 var result = _runUnittest(["--help"]);
63 expect(result.stdout, equals(""" 64 expect(result.stdout, equals("""
64 Runs tests in this package. 65 Runs tests in this package.
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 }); 371 });
371 }); 372 });
372 }); 373 });
373 } 374 }
374 375
375 ProcessResult _runUnittest(List<String> args) => 376 ProcessResult _runUnittest(List<String> args) =>
376 runUnittest(args, workingDirectory: _sandbox); 377 runUnittest(args, workingDirectory: _sandbox);
377 378
378 ProcessResult _runDart(List<String> args) => 379 ProcessResult _runDart(List<String> args) =>
379 runDart(args, workingDirectory: _sandbox); 380 runDart(args, workingDirectory: _sandbox);
OLDNEW
« no previous file with comments | « test/runner/parse_metadata_test.dart ('k') | test/runner/signal_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698