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

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

Issue 247223009: Reduce test.dart memory usage (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Clear static pointer to closure when finished Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/testing/dart/test_runner.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 b3e216d70c901b8701a4c02cc869fcb214645796..d4f758e1e5f3eeef78bc0357cf8b9b5f5f3d7c39 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -260,13 +260,8 @@ abstract class TestSuite {
// Handle sharding based on the original test path (i.e. all multitests
// of a given original test belong to the same shard)
int shards = configuration['shards'];
- if (shards > 1) {
- int shard = configuration['shard'];
- var testPath =
- testCase.info.originTestPath.relativeTo(TestUtils.dartDir);
- if ("$testPath".hashCode % shards != shard - 1) {
- return;
- }
+ if (shards > 1 && testCase.hash % shards != configuration['shard'] - 1) {
+ return;
}
// Test if the selector includes this test.
RegExp pattern = configuration['selectors'][suiteName];
@@ -277,8 +272,7 @@ abstract class TestSuite {
// Update Summary report
if (configuration['report']) {
SummaryReport.add(expectations);
- if (testCase.info != null &&
- testCase.expectCompileError &&
+ if (testCase.expectCompileError &&
TestUtils.isBrowserRuntime(configuration['runtime']) &&
new CompilerConfiguration(configuration).hasCompiler) {
SummaryReport.addCompileErrorSkipTest();
@@ -503,7 +497,6 @@ class CCTestSuite extends TestSuite {
String hostRunnerPath;
final String dartDir;
List<String> statusFilePaths;
- VoidFunction doDone;
CCTestSuite(Map configuration,
String suiteName,
@@ -545,8 +538,6 @@ class CCTestSuite extends TestSuite {
void forEachTest(Function onTest, Map testCache, [VoidFunction onDone]) {
doTest = onTest;
- doDone = onDone;
-
var statusFiles =
statusFilePaths.map((statusFile) => "$dartDir/$statusFile").toList();
@@ -554,7 +545,8 @@ class CCTestSuite extends TestSuite {
.then((TestExpectations expectations) {
ccTestLister(hostRunnerPath).then((Iterable<String> names) {
names.forEach((testName) => testNameHandler(expectations, testName));
- onDone();
+ doTest = null;
+ if (onDone != null) onDone();
}).catchError((error) {
print("Fatal error occured: $error");
exit(1);
@@ -1810,6 +1802,7 @@ class PkgBuildTestSuite extends TestSuite {
localPackageDirectories.forEach(enqueueTestCase);
localSampleDirectories.forEach(enqueueTestCase);
+ doTest = null;
// Notify we're done
if (onDone != null) onDone();
}
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698