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

Side by Side Diff: test/test_pub.dart

Issue 1226083002: Fix several Windows issues. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Remove CR LF fixes. Created 5 years, 5 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/run/forwards_signal_posix_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// Test infrastructure for testing pub. 5 /// Test infrastructure for testing pub.
6 /// 6 ///
7 /// Unlike typical unit tests, most pub tests are integration tests that stage 7 /// Unlike typical unit tests, most pub tests are integration tests that stage
8 /// some stuff on the file system, run pub, and then validate the results. This 8 /// some stuff on the file system, run pub, and then validate the results. This
9 /// library provides an API to build tests like that. 9 /// library provides an API to build tests like that.
10 library test_pub; 10 library test_pub;
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 _integration(description, body, test); 374 _integration(description, body, test);
375 375
376 /// Like [integration], but causes only this test to run. 376 /// Like [integration], but causes only this test to run.
377 void solo_integration(String description, void body()) => 377 void solo_integration(String description, void body()) =>
378 _integration(description, body, solo_test); 378 _integration(description, body, solo_test);
379 379
380 void _integration(String description, void body(), [Function testFn]) { 380 void _integration(String description, void body(), [Function testFn]) {
381 testFn(description, () { 381 testFn(description, () {
382 _sandboxDir = createSystemTempDir(); 382 _sandboxDir = createSystemTempDir();
383 d.defaultRoot = sandboxDir; 383 d.defaultRoot = sandboxDir;
384 currentSchedule.onComplete.schedule(() => deleteEntry(_sandboxDir), 384 currentSchedule.onComplete.schedule(() {
385 'deleting the sandbox directory'); 385 try {
386 deleteEntry(_sandboxDir);
387 } on ApplicationException catch (_) {
388 // Silently swallow exceptions on Windows. If the test failed, there may
389 // still be lingering processes that have files in the sandbox open,
390 // which will cause this to fail on Windows.
391 if (!Platform.isWindows) rethrow;
392 }
393 }, 'deleting the sandbox directory');
386 394
387 // Schedule the test. 395 // Schedule the test.
388 body(); 396 body();
389 }); 397 });
390 } 398 }
391 399
392 /// Schedules renaming (moving) the directory at [from] to [to], both of which 400 /// Schedules renaming (moving) the directory at [from] to [to], both of which
393 /// are assumed to be relative to [sandboxDir]. 401 /// are assumed to be relative to [sandboxDir].
394 void scheduleRename(String from, String to) { 402 void scheduleRename(String from, String to) {
395 schedule( 403 schedule(
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
991 _lastMatcher.matches(item.last, matchState); 999 _lastMatcher.matches(item.last, matchState);
992 } 1000 }
993 1001
994 Description describe(Description description) { 1002 Description describe(Description description) {
995 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); 1003 return description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]);
996 } 1004 }
997 } 1005 }
998 1006
999 /// A [StreamMatcher] that matches multiple lines of output. 1007 /// A [StreamMatcher] that matches multiple lines of output.
1000 StreamMatcher emitsLines(String output) => inOrder(output.split("\n")); 1008 StreamMatcher emitsLines(String output) => inOrder(output.split("\n"));
OLDNEW
« no previous file with comments | « test/run/forwards_signal_posix_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698