Index: tests/compiler/dart2js/serialization/helper.dart |
diff --git a/tests/compiler/dart2js/serialization/helper.dart b/tests/compiler/dart2js/serialization/helper.dart |
index 4a344c077cd374e8f9d72c384d7c585c379303e8..b9ca9d45fcbfe1f353cab29dbd84d7292390d34f 100644 |
--- a/tests/compiler/dart2js/serialization/helper.dart |
+++ b/tests/compiler/dart2js/serialization/helper.dart |
@@ -30,10 +30,12 @@ import 'package:compiler/src/universe/world_impact.dart'; |
import 'package:compiler/src/universe/use.dart'; |
import '../memory_compiler.dart'; |
+import 'test_data.dart'; |
class Arguments { |
final String filename; |
- final int index; |
+ final int start; |
+ final int end; |
final bool loadSerializedData; |
final bool saveSerializedData; |
final String serializedDataFileName; |
@@ -41,7 +43,8 @@ class Arguments { |
const Arguments({ |
this.filename, |
- this.index, |
+ this.start, |
+ this.end, |
this.loadSerializedData: false, |
this.saveSerializedData: false, |
this.serializedDataFileName: 'out.data', |
@@ -49,12 +52,17 @@ class Arguments { |
factory Arguments.from(List<String> arguments) { |
String filename; |
- int index; |
+ int start; |
+ int end; |
for (String arg in arguments) { |
if (!arg.startsWith('-')) { |
- index = int.parse(arg); |
+ int index = int.parse(arg); |
if (index == null) { |
filename = arg; |
+ } else if (start == null) { |
+ start = index; |
+ } else { |
+ end = index; |
} |
} |
} |
@@ -63,11 +71,21 @@ class Arguments { |
bool saveSerializedData = arguments.contains('-s'); |
return new Arguments( |
filename: filename, |
- index: index, |
+ start: start, |
+ end: end, |
verbose: verbose, |
loadSerializedData: loadSerializedData, |
saveSerializedData: saveSerializedData); |
} |
+ |
+ Future forEachTest(List<Test> tests, Future f(int index, Test test)) async { |
+ int first = start ?? 0; |
+ int last = end ?? tests.length - 1; |
+ for (int index = first; index <= last; index++) { |
+ Test test = TESTS[index]; |
+ await f(index, test); |
+ } |
+ } |
} |