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

Unified Diff: tools/testing/dart/test_suite.dart

Issue 1731023003: - Include a random number in the full snapshot filename as some of the tests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: code-review Created 4 years, 10 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 | « tools/testing/dart/test_configurations.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 21a99a82c2a4462556dd8d0e0ec78537907c7993..56ed6bae16de935191796184221b97f38e703032 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -16,6 +16,7 @@ library test_suite;
import "dart:async";
import "dart:io";
+import "dart:math";
import "drt_updater.dart";
import "html_test.dart" as htmlTest;
import "path.dart";
@@ -2149,6 +2150,7 @@ class TestUtils {
dartDirUri = uri;
dartDir = new Path(uri.toFilePath());
}
+ static Random rand = new Random.secure();
static Uri dartDirUri;
static Path dartDir;
static LastModifiedCache lastModifiedCache = new LastModifiedCache();
@@ -2157,6 +2159,13 @@ class TestUtils {
new Path(Directory.current.path);
/**
+ * Generates a random number.
+ */
+ static int getRandomNumber() {
+ return rand.nextInt(0xffffffff);
+ }
+
+ /**
* Creates a directory using a [relativePath] to an existing
* [base] directory if that [relativePath] does not already exist.
*/
@@ -2232,6 +2241,22 @@ class TestUtils {
}
}
+ static deleteTempSnapshotDirectory(Map configuration) {
+ if (configuration['compiler'] == 'dart2app') {
+ var checked = configuration['checked'] ? '-checked' : '';
+ var minified = configuration['minified'] ? '-minified' : '';
+ var csp = configuration['csp'] ? '-csp' : '';
+ var sdk = configuration['use_sdk'] ? '-sdk' : '';
+ var packages = configuration['use_public_packages']
+ ? '-public_packages' : '';
+ var dirName = "${configuration['compiler']}"
+ "$checked$minified$csp$packages$sdk";
+ String generatedPath = "${TestUtils.buildDir(configuration)}"
+ "/generated_compilations/$dirName";
+ TestUtils.deleteDirectory(generatedPath);
+ }
+ }
+
static Path debugLogfile() {
return new Path(".debug.log");
}
« no previous file with comments | « tools/testing/dart/test_configurations.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698