Skip to content

Commit b566ba1

Browse files
johnniwintherCommit Bot
authored and
Commit Bot
committed
[cfe] Run incremental macro tests in separate incremental compilers
The way constants are printed using ast-to-text depend on which libraries are available in the component. Because the incremental compiler (by default) only returns the libraries that have been recompiled, the first compilation contains more libraries than the subsequent compilations. Using the same incremental compiler throughout the incremental macro test made the output depend on the order in which the tests were run, which in turn was dependent on the file order in the directory. To avoid this, and to support running individual tests with a stable output, each test is now using its own increment compiler for all the incremental steps within the test. Closes #48558 Change-Id: I37946ed0f940b6644c5efb2b7d167b2a5717f2f3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/240721 Reviewed-by: Chloe Stefantsova <[email protected]> Commit-Queue: Johnni Winther <[email protected]>
1 parent a17bd9e commit b566ba1

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

pkg/front_end/test/macros/incremental/data/tests/in_body_change.0.dart.expect

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ class Class extends core::Object {
1818
}
1919

2020
constants {
21-
#C1 = #lib1::ToStringMacro {}
21+
#C1 = mac::ToStringMacro {}
2222
}

pkg/front_end/test/macros/incremental/data/tests/inject_macro.0.dart.expect

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ class Class extends core::Object {
1515
}
1616

1717
constants {
18-
#C1 = #lib1::InjectMacro {}
18+
#C1 = mac::InjectMacro {}
1919
}

pkg/front_end/test/macros/incremental/data/tests/user_macro/main.0.dart.expect

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ static method generateBody() → core::String {
4949

5050
constants {
5151
#C1 = mac::MethodMacro {}
52-
#C2 = dart.core::_Override {}
52+
#C2 = core::_Override {}
5353
}

pkg/front_end/test/macros/incremental/incremental_macro_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ Future<void> main(List<String> args) async {
102102

103103
await CompilerContext.runWithOptions(processedOptions,
104104
(CompilerContext context) async {
105-
IncrementalCompiler compiler = new IncrementalCompiler(context);
106105
for (Test test in tests.values) {
107106
if (args.isNotEmpty && !args.contains(test.name)) {
108107
print('Skipped ${test.name}');
109108
continue;
110109
}
110+
IncrementalCompiler compiler = new IncrementalCompiler(context);
111111
Uri entryPoint = test.entryPoint;
112112
for (TestUpdate update in test.updates) {
113113
print('Running ${test.name} update ${update.index}');

0 commit comments

Comments
 (0)