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

Unified Diff: tests/compiler/dart2js/serialization/test_helper.dart

Issue 2162053005: Split serialization tests further (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Rename Created 4 years, 5 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 | « tests/compiler/dart2js/serialization/test_data.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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}'];
+ }
+}
« no previous file with comments | « tests/compiler/dart2js/serialization/test_data.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698