Reland "[cfe] Run suite in together in update_expectations.dart"

This speeds up update_expectations.dart by avoid to restart
the expectation testing for each suite.

Change-Id: If0a4562f92f106c1c04bd22a81eb28e52591c4b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/343220
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
Johnni Winther
2023-12-21 14:42:46 +00:00
committed by Commit Queue
parent 49cd3d9657
commit 39b44a02f5
2 changed files with 14 additions and 13 deletions
+13 -12
View File
@@ -21,22 +21,23 @@ const List<String> specialSuites = <String>[
Future<void> runStandardSuites([List<String>? args]) async {
// Assert that 'strong' is the first suite - we use the assumption below.
assert(standardSuites.first == 'weak', "Suite 'weak' most be the first.");
bool first = true;
List<String> testingArguments = [];
for (String suite in standardSuites) {
List<String> tests = args == null
? [suite]
: args.map((String arg) => '${suite}/$arg').toList();
await fasta.main([
'testing',
...tests,
// Only update comments in the first suite. Note that this only works
// if the first compilation is a full compilation, i.e. not outline,
// because comments are generated during body building and inference.
if (first) '-DupdateComments=true',
'-DupdateExpectations=true'
]);
first = false;
testingArguments.addAll(tests);
}
await fasta.main([
'testing',
...testingArguments,
// Only update comments in the first suite. Note that this only works
// if the first compilation is a full compilation, i.e. not outline,
// because comments are generated during body building and inference.
'-DupdateComments=true',
'-DupdateExpectations=true'
]);
}
Future<void> main(List<String> args) async {
@@ -61,7 +62,7 @@ Future<void> main(List<String> args) async {
}
}
if (standardTests.isNotEmpty) {
await runStandardSuites(args);
await runStandardSuites(standardTests);
}
}
}
+1 -1
View File
@@ -72,7 +72,7 @@ class Chain extends Suite {
void writeClosureOn(StringSink sink) {
sink.write("await runChain(");
sink.write(name);
sink.writeln(".createContext, environment, selectors, r'''");
sink.writeln(".createContext, {...environment}, selectors, r'''");
const String jsonExtraIndent = " ";
sink.write(jsonExtraIndent);
sink.writeAll(splitLines(JsonEncoder.withIndent(" ").convert(this)),