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

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: Update to use open-ended intervals and separate method for skipped tests. 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..2c74a07537fd33fd2087f5f17f42ddfcd6118dca 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,33 @@ void checkResolvedAsts(Compiler compiler1, Element member1,
testResolvedAstEquivalence(
resolvedAst1, resolvedAst2, const CheckStrategy());
}
+
+/// Returns the test arguments for testing the [index]th skipped test. The
+/// [skip] count is used to check that [index] is a valid index.
+List<String> testSkipped(int index, int skip) {
+ if (index < 0 || index >= skip) {
+ throw new ArgumentError('Invalid skip index $index');
+ }
+ return ['${index}', '${index + 1}'];
+}
+
+/// Return the test arguments for testing the [index]th segment (1-based) of
+/// the [TESTS] split into [count] groups. The first [skip] tests are excluded
+/// from the automatic grouping.
+List<String> testSegment(int index, int count, int skip) {
+ if (index < 0 || index > count) {
+ throw new ArgumentError('Invalid segment index $index');
+ }
+
+ String segmentNumber(int i) {
+ return '${skip + i * (TESTS.length - skip) ~/ count}';
+ }
+
+ if (index == 1 && skip != 0) {
+ return ['${skip}', segmentNumber(index)];
+ } else if (index == count) {
+ return [segmentNumber(index - 1)];
+ } else {
+ return [segmentNumber(index - 1), segmentNumber(index)];
+ }
+}
« 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