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

Unified Diff: lib/src/io.dart

Issue 1216433003: Stop auto-generating Pub snapshots for testing. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .gitignore ('k') | test/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/io.dart
diff --git a/lib/src/io.dart b/lib/src/io.dart
index 944e0a5a8c995f9ae15e2499569954ce37a7f0e6..24c45d88776a9233c5be718b28590911ae808e51 100644
--- a/lib/src/io.dart
+++ b/lib/src/io.dart
@@ -484,9 +484,9 @@ final bool runningAsTest =
/// Whether the current process is a pub subprocess being run from a test.
///
-/// This works because when running from tests, pub always uses a snapshot named
-/// "pub.test.snapshot", which is not used outside of tests.
-final bool runningFromTest = Platform.script.path.endsWith('.test.snapshot');
+/// The "_PUB_TESTING" variable is automatically set for all the test code's
+/// invocations of pub.
+final bool runningFromTest = Platform.environment.containsKey('_PUB_TESTING');
/// Whether pub is running from within the Dart SDK, as opposed to from the Dart
/// source repository.
« no previous file with comments | « .gitignore ('k') | test/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698