Index: tests/compiler/dart2js/serialization/test_helper.dart |
diff --git a/tests/compiler/dart2js/serialization/test_helper.dart b/tests/compiler/dart2js/serialization/test_helper.dart |
index 9d3115f51e35ca794c3b51d5132d6968d835b442..b4c99f4b95b3ae0f3551cda3d5c4257fad5c35bc 100644 |
--- a/tests/compiler/dart2js/serialization/test_helper.dart |
+++ b/tests/compiler/dart2js/serialization/test_helper.dart |
@@ -13,6 +13,7 @@ import 'package:compiler/src/elements/elements.dart'; |
import 'package:compiler/src/serialization/equivalence.dart'; |
import 'package:compiler/src/tree/nodes.dart'; |
import 'package:expect/expect.dart'; |
+import 'test_data.dart'; |
Check currentCheck; |
@@ -589,3 +590,23 @@ void checkResolvedAsts(Compiler compiler1, Element member1, |
testResolvedAstEquivalence( |
resolvedAst1, resolvedAst2, const CheckStrategy()); |
} |
+ |
+/// Return the test arguments for testing the [index]th segment (1-based) of |
Bill Hesse
2016/07/20 13:46:45
I think you should have two functions, one for ret
Johnni Winther
2016/07/25 08:30:08
Done.
|
+/// the [TESTS] split into [count] groups. The first [skip] tests are excluded |
+/// from the automatic grouping and tested if `index <= 0`. |
+List<String> testSegment(int index, int count, int skip) { |
+ |
+ int segmentNumber(int i) { |
+ return skip + i * (TESTS.length - skip) ~/ count; |
+ } |
+ |
+ if (index <= 0) { |
+ return ['${-index}', '${-index}']; |
+ } else if (index == 1 && skip != 0) { |
+ return ['${skip}', '${segmentNumber(index) - 1}']; |
+ } else if (index == count) { |
+ return ['${segmentNumber(index - 1)}']; |
+ } else { |
+ return ['${segmentNumber(index - 1)}', '${segmentNumber(index) - 1}']; |
+ } |
+} |