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

Side by Side Diff: test/runner/parse_metadata_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/loader_test.dart ('k') | test/runner/runner_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/test.dart'; 10 import 'package:test/test.dart';
11 import 'package:test/src/backend/platform_selector.dart'; 11 import 'package:test/src/backend/platform_selector.dart';
12 import 'package:test/src/backend/test_platform.dart'; 12 import 'package:test/src/backend/test_platform.dart';
13 import 'package:test/src/runner/parse_metadata.dart'; 13 import 'package:test/src/runner/parse_metadata.dart';
14 import 'package:test/src/util/io.dart';
14 15
15 String _sandbox; 16 String _sandbox;
16 String _path; 17 String _path;
17 18
18 void main() { 19 void main() {
19 setUp(() { 20 setUp(() {
20 _sandbox = Directory.systemTemp.createTempSync('test_').path; 21 _sandbox = createTempDir();
21 _path = p.join(_sandbox, "test.dart"); 22 _path = p.join(_sandbox, "test.dart");
22 }); 23 });
23 24
24 tearDown(() { 25 tearDown(() {
25 new Directory(_sandbox).deleteSync(recursive: true); 26 new Directory(_sandbox).deleteSync(recursive: true);
26 }); 27 });
27 28
28 test("returns empty metadata for an empty file", () { 29 test("returns empty metadata for an empty file", () {
29 new File(_path).writeAsStringSync(""); 30 new File(_path).writeAsStringSync("");
30 var metadata = parseMetadata(_path); 31 var metadata = parseMetadata(_path);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 expect(() => parseMetadata(_path), throwsFormatException); 92 expect(() => parseMetadata(_path), throwsFormatException);
92 }); 93 });
93 94
94 test("multiple @TestOns", () { 95 test("multiple @TestOns", () {
95 new File(_path).writeAsStringSync( 96 new File(_path).writeAsStringSync(
96 "@TestOn('foo')\n@TestOn('bar')\nlibrary foo;"); 97 "@TestOn('foo')\n@TestOn('bar')\nlibrary foo;");
97 expect(() => parseMetadata(_path), throwsFormatException); 98 expect(() => parseMetadata(_path), throwsFormatException);
98 }); 99 });
99 }); 100 });
100 } 101 }
OLDNEW
« no previous file with comments | « test/runner/loader_test.dart ('k') | test/runner/runner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698