Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191335
b: refs/heads/beta
c: 7dbf8ee
h: refs/heads/master
i:
  191333: a233dba
  191331: 162fa89
  191327: 4a0d992
  • Loading branch information
johnniwinther authored and commit-bot@chromium.org committed Aug 27, 2019
1 parent 5913c78 commit 6d94b68
Show file tree
Hide file tree
Showing 29 changed files with 91 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ refs/tags/2.3.0-flutter-1.5.4-hotfix.1: a1668566e563aef64025d0af88a099cbbe847b7e
refs/tags/2.3.1: 929b013ddc83a013b49a98fc28b6b503a972bddd
refs/tags/2.3.1-dev.0.0: 1d1742efd39cd4762b844b510acf8c2f1fa6604e
refs/tags/2.3.2-dev.0.0: c567183bac8a895014d79cd3bf1d8908d45547d6
refs/heads/beta: 6c67280e44d8e98bc822f72176e1948725c6798e
refs/heads/beta: 7dbf8eed3b251bfaada52ae8e231efd4c21089a6
refs/heads/sjindel.mep: b113b36c157cf54b257e82550e9bbde16f05ad8d
refs/tags/2.3.2: f7ab96133aa79301daf812ef40b33c99d8ad1495
refs/tags/2.3.2-dev.0.1: ef57e27c9798b54a54e9a1f74b1bd1f9be7290b1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ class DevCompilerRunner implements CompilerRunner {
}

void main(List<String> arguments) =>
runMe(arguments, createContext, "testing.json");
runMe(arguments, createContext, configurationPath: "testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ class DevCompilerRunner implements CompilerRunner {
}

void main(List<String> arguments) =>
runMe(arguments, createContext, "testing.json");
runMe(arguments, createContext, configurationPath: "testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class StackTraceContext extends ChainContextWithCleanupHelper {
}

void main(List<String> arguments) =>
runMe(arguments, createContext, "testing.json");
runMe(arguments, createContext, configurationPath: "testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ class StackTraceContext extends ChainContextWithCleanupHelper
}

void main(List<String> arguments) =>
runMe(arguments, createContext, "testing.json");
runMe(arguments, createContext, configurationPath: "testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -433,4 +433,4 @@ Future<Context> createContext(
}

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../../testing.json");
runMe(arguments, createContext, configurationPath: "../../testing.json");
3 changes: 2 additions & 1 deletion branches/beta/pkg/front_end/test/fasta/fast_strong_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ Future<FastaContext> createContext(
}

main([List<String> arguments = const []]) => runMe(arguments, createContext,
"../../testing.json", Platform.script.resolve("strong_test.dart"));
configurationPath: "../../testing.json",
me: Platform.script.resolve("strong_tester.dart"));
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,4 @@ Future<Context> createContext(
}

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../../testing.json");
runMe(arguments, createContext, configurationPath: "../../testing.json");
2 changes: 1 addition & 1 deletion branches/beta/pkg/front_end/test/fasta/messages_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -663,4 +663,4 @@ String relativize(Uri uri) {
}

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../../testing.json");
runMe(arguments, createContext, configurationPath: "../../testing.json");
2 changes: 1 addition & 1 deletion branches/beta/pkg/front_end/test/fasta/outline_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ Future<FastaContext> createContext(
}

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../../testing.json");
runMe(arguments, createContext, configurationPath: "../../testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ class Parse extends Step<ScannedFile, Null, ChainContext> {
}

main(List<String> arguments) =>
runMe(arguments, createContext, "../../../testing.json");
runMe(arguments, createContext, configurationPath: "../../../testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ class ScannerContext extends ChainContext {
}

main(List<String> arguments) =>
runMe(arguments, createContext, "../../../testing.json");
runMe(arguments, createContext, configurationPath: "../../../testing.json");
9 changes: 9 additions & 0 deletions branches/beta/pkg/front_end/test/fasta/strong1_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.

import 'strong_tester.dart';

main(List<String> arguments) {
internalMain(arguments: arguments, shards: shardCount, shard: 0);
}
9 changes: 9 additions & 0 deletions branches/beta/pkg/front_end/test/fasta/strong2_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.

import 'strong_tester.dart';

main(List<String> arguments) {
internalMain(arguments: arguments, shards: shardCount, shard: 1);
}
9 changes: 9 additions & 0 deletions branches/beta/pkg/front_end/test/fasta/strong3_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.

import 'strong_tester.dart';

main(List<String> arguments) {
internalMain(arguments: arguments, shards: shardCount, shard: 2);
}
9 changes: 9 additions & 0 deletions branches/beta/pkg/front_end/test/fasta/strong4_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE.md file.

import 'strong_tester.dart';

main(List<String> arguments) {
internalMain(arguments: arguments, shards: shardCount, shard: 3);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,27 @@
library fasta.test.strong_test;

import 'dart:async' show Future;
import 'dart:io' show Platform;

import 'testing/suite.dart';

const int shardCount = 4;

Future<FastaContext> createContext(
Chain suite, Map<String, String> environment) {
environment[ENABLE_FULL_COMPILE] = "";
return FastaContext.create(suite, environment);
}

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../../testing.json");
main(List<String> arguments) {
internalMain(arguments: arguments);
}

internalMain(
{List<String> arguments = const [], int shards = 1, int shard = 0}) {
runMe(arguments, createContext,
configurationPath: "../../testing.json",
me: Platform.script.resolve('strong_tester.dart'),
shards: shards,
shard: shard);
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Future<FastaContext> createContext(
}

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../../testing.json");
runMe(arguments, createContext, configurationPath: "../../testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,4 @@ class CheckTypePromotionResult
}

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../../testing.json");
runMe(arguments, createContext, configurationPath: "../../testing.json");
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import 'package:testing/testing.dart'
import 'incremental_utils.dart' as util;

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../testing.json");
runMe(arguments, createContext, configurationPath: "../testing.json");

Future<Context> createContext(
Chain suite, Map<String, String> environment) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import 'package:testing/testing.dart' show Chain, runMe;
import 'incremental_bulk_compiler_full.dart' show Context;

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../testing.json");
runMe(arguments, createContext, configurationPath: "../testing.json");

Future<Context> createContext(
Chain suite, Map<String, String> environment) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ import 'package:front_end/src/fasta/fasta_codes.dart'
show DiagnosticMessageFromJson, FormattedMessage;

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../testing.json");
runMe(arguments, createContext, configurationPath: "../testing.json");

Future<Context> createContext(
Chain suite, Map<String, String> environment) async {
Expand Down
2 changes: 1 addition & 1 deletion branches/beta/pkg/front_end/test/lint_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import 'package:testing/testing.dart'
show Chain, ChainContext, Result, Step, TestDescription, runMe;

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../testing.json");
runMe(arguments, createContext, configurationPath: "../testing.json");

Future<Context> createContext(
Chain suite, Map<String, String> environment) async {
Expand Down
2 changes: 1 addition & 1 deletion branches/beta/pkg/front_end/test/old_dill_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Future<Null> main([List<String> arguments = const []]) async {
await checkDill();
return null;
}
await runMe(arguments, createContext, "../testing.json");
await runMe(arguments, createContext, configurationPath: "../testing.json");
await checkDill();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'spelling_test_base.dart';
import 'spell_checking_utils.dart' as spell;

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../testing.json");
runMe(arguments, createContext, configurationPath: "../testing.json");

Future<Context> createContext(
Chain suite, Map<String, String> environment) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'spelling_test_base.dart';
import 'spell_checking_utils.dart' as spell;

main([List<String> arguments = const []]) =>
runMe(arguments, createContext, "../testing.json");
runMe(arguments, createContext, configurationPath: "../testing.json");

Future<Context> createContext(
Chain suite, Map<String, String> environment) async {
Expand Down
2 changes: 1 addition & 1 deletion branches/beta/pkg/front_end/testing.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{
"name": "strong",
"kind": "Chain",
"source": "test/fasta/strong_test.dart",
"source": "test/fasta/strong_tester.dart",
"path": "testcases/",
"status": "testcases/strong.status",
"pattern": [
Expand Down
15 changes: 14 additions & 1 deletion branches/beta/pkg/testing/lib/src/chain.dart
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ abstract class ChainContext {

ExpectationSet get expectationSet => ExpectationSet.Default;

Future<Null> run(Chain suite, Set<String> selectors) async {
Future<Null> run(Chain suite, Set<String> selectors,
{int shards = 1, int shard = 0}) async {
assert(shards >= 1, "Invalid shards count: $shards");
assert(0 <= shard && shard < shards,
"Invalid shard index: $shard, not in range [0,$shards[.");
List<String> partialSelectors = selectors
.where((s) => s.endsWith('...'))
.map((s) => s.substring(0, s.length - 3))
Expand All @@ -124,6 +128,15 @@ abstract class ChainContext {
}
List<TestDescription> descriptions = await stream.toList();
descriptions.sort();
if (shards > 1) {
List<TestDescription> shardDescriptions = [];
for (int index = 0; index < descriptions.length; index++) {
if (index % shards == shard) {
shardDescriptions.add(descriptions[index]);
}
}
descriptions = shardDescriptions;
}
Map<TestDescription, Result> unexpectedResults =
<TestDescription, Result>{};
Map<TestDescription, Set<Expectation>> unexpectedOutcomes =
Expand Down
5 changes: 3 additions & 2 deletions branches/beta/pkg/testing/lib/src/run.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Future<TestRoot> computeTestRoot(String configurationPath, Uri base) {
/// `testing.json` isn't located in the current working directory and is a path
/// relative to [me] which defaults to `Platform.script`.
Future<Null> runMe(List<String> arguments, CreateContext f,
[String configurationPath, Uri me]) {
{String configurationPath, Uri me, int shards = 1, int shard = 0}) {
me ??= Platform.script;
return withErrorHandling(() async {
TestRoot testRoot = await computeTestRoot(configurationPath, me);
Expand All @@ -65,7 +65,8 @@ Future<Null> runMe(List<String> arguments, CreateContext f,
if (me == suite.source) {
print("Running suite ${suite.name}...");
ChainContext context = await f(suite, cl.environment);
await context.run(suite, new Set<String>.from(cl.selectors));
await context.run(suite, new Set<String>.from(cl.selectors),
shards: shards, shard: shard);
}
}
});
Expand Down

0 comments on commit 6d94b68

Please sign in to comment.