Split more DDC tests between AMD and DDC Library Bundle module systems (#2789)
Migrates more tests to `*_amd_test` and `_ddc_library_bundle_test` files.
diff --git a/dwds/CHANGELOG.md b/dwds/CHANGELOG.md
index 09955af..cf0cb27 100644
--- a/dwds/CHANGELOG.md
+++ b/dwds/CHANGELOG.md
@@ -10,6 +10,7 @@
- Add sourcemap logic fixes to DDC Library Bundle + build_runner execution scheme.
- Update pathing logic for Windows and the DDC Library Bundle module system.
- Fix serialization of `HotRestartRequest` in `AppConnection`.
+- Split additional tests across DDC module systems.
## 27.0.0
- Remove `package:built_value`, `package:built_value_generator`, and `package:built_collection` dependencies.
diff --git a/dwds/test/integration/dds_port_amd_test.dart b/dwds/test/integration/dds_port_amd_test.dart
new file mode 100644
index 0000000..327bc28
--- /dev/null
+++ b/dwds/test/integration/dds_port_amd_test.dart
@@ -0,0 +1,19 @@
+// Copyright (c) 2026, 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 file.
+
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'dds_port_common.dart';
+
+void main() {
+ final provider = TestSdkConfigurationProvider();
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider);
+}
diff --git a/dwds/test/integration/dds_port_test.dart b/dwds/test/integration/dds_port_common.dart
similarity index 76%
rename from dwds/test/integration/dds_port_test.dart
rename to dwds/test/integration/dds_port_common.dart
index 7484c86..8899963 100644
--- a/dwds/test/integration/dds_port_test.dart
+++ b/dwds/test/integration/dds_port_common.dart
@@ -2,32 +2,30 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@TestOn('vm')
-@Timeout(Duration(minutes: 2))
-library;
-
import 'dart:io';
import 'package:dwds/dwds.dart';
import 'package:test/test.dart';
+import 'package:test_common/logging.dart';
import 'package:test_common/test_sdk_configuration.dart';
import 'fixtures/context.dart';
import 'fixtures/project.dart';
import 'fixtures/utilities.dart';
-void main() {
- late TestSdkConfigurationProvider provider;
+void testAll({
+ required TestSdkConfigurationProvider provider,
+ bool debug = false,
+}) {
late TestContext context;
setUp(() {
- provider = TestSdkConfigurationProvider();
+ setCurrentLogWriter(debug: debug);
context = TestContext(TestProject.test, provider);
});
tearDown(() async {
await context.tearDown();
- provider.dispose();
});
test('DWDS starts DDS with a specified port (deprecated)', () async {
@@ -37,6 +35,11 @@
await server.close();
await context.setUp(
+ testSettings: TestSettings(
+ verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
+ ),
debugSettings: TestDebugSettings.noDevToolsLaunch().copyWith(
ddsPort: expectedPort,
),
@@ -52,6 +55,11 @@
await server.close();
await context.setUp(
+ testSettings: TestSettings(
+ verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
+ ),
debugSettings: TestDebugSettings.noDevToolsLaunch().copyWith(
ddsConfiguration: DartDevelopmentServiceConfiguration(
port: expectedPort,
diff --git a/dwds/test/integration/dds_port_ddc_library_bundle_test.dart b/dwds/test/integration/dds_port_ddc_library_bundle_test.dart
new file mode 100644
index 0000000..41093db
--- /dev/null
+++ b/dwds/test/integration/dds_port_ddc_library_bundle_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2026, 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 file.
+
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:dwds/expression_compiler.dart';
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'dds_port_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+
+ final canary = true;
+ final provider = TestSdkConfigurationProvider(
+ verbose: debug,
+ canaryFeatures: canary,
+ ddcModuleFormat: ModuleFormat.ddc,
+ );
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider, debug: debug);
+}
diff --git a/dwds/test/integration/debug_service_amd_test.dart b/dwds/test/integration/debug_service_amd_test.dart
new file mode 100644
index 0000000..2640483
--- /dev/null
+++ b/dwds/test/integration/debug_service_amd_test.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2026, 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 file.
+
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'debug_service_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+ final provider = TestSdkConfigurationProvider(verbose: debug);
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider);
+}
diff --git a/dwds/test/integration/debug_service_test.dart b/dwds/test/integration/debug_service_common.dart
similarity index 91%
rename from dwds/test/integration/debug_service_test.dart
rename to dwds/test/integration/debug_service_common.dart
index 67089ca..2051a67 100644
--- a/dwds/test/integration/debug_service_test.dart
+++ b/dwds/test/integration/debug_service_common.dart
@@ -2,10 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@TestOn('vm')
-@Timeout(Duration(minutes: 2))
-library;
-
import 'dart:io';
import 'package:dwds/dwds.dart';
@@ -18,15 +14,20 @@
import 'fixtures/project.dart';
import 'fixtures/utilities.dart';
-void main() {
- final provider = TestSdkConfigurationProvider();
- tearDownAll(provider.dispose);
-
+void testAll({
+ required TestSdkConfigurationProvider provider,
+ bool debug = false,
+}) {
final context = TestContext(TestProject.test, provider);
setUpAll(() async {
// Disable DDS as we're testing DWDS behavior.
await context.setUp(
+ testSettings: TestSettings(
+ verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
+ ),
debugSettings: TestDebugSettings.noDevToolsLaunch().copyWith(
spawnDds: false,
ddsConfiguration: DartDevelopmentServiceConfiguration(enable: false),
diff --git a/dwds/test/integration/debug_service_ddc_library_bundle_test.dart b/dwds/test/integration/debug_service_ddc_library_bundle_test.dart
new file mode 100644
index 0000000..3d3cd59
--- /dev/null
+++ b/dwds/test/integration/debug_service_ddc_library_bundle_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2026, 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 file.
+
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:dwds/expression_compiler.dart';
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'debug_service_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+ final canary = true;
+ final provider = TestSdkConfigurationProvider(
+ verbose: debug,
+ canaryFeatures: canary,
+ ddcModuleFormat: ModuleFormat.ddc,
+ );
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider, debug: debug);
+}
diff --git a/dwds/test/integration/evaluate_parts_common.dart b/dwds/test/integration/evaluate_parts_common.dart
index e417164..7b207dd 100644
--- a/dwds/test/integration/evaluate_parts_common.dart
+++ b/dwds/test/integration/evaluate_parts_common.dart
@@ -76,6 +76,8 @@
enableExpressionEvaluation: true,
useDebuggerModuleNames: useDebuggerModuleNames,
verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
),
);
diff --git a/dwds/test/integration/events_amd_test.dart b/dwds/test/integration/events_amd_test.dart
new file mode 100644
index 0000000..b8a749b
--- /dev/null
+++ b/dwds/test/integration/events_amd_test.dart
@@ -0,0 +1,81 @@
+// Copyright (c) 2026, 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 file.
+
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'dart:async';
+import 'dart:io';
+
+import 'package:dwds/src/events.dart';
+import 'package:dwds/src/utilities/server.dart';
+import 'package:test/test.dart';
+import 'package:test_common/logging.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'events_common.dart';
+
+void main() {
+ final provider = TestSdkConfigurationProvider();
+ tearDownAll(provider.dispose);
+
+ group('serve requests', () {
+ late HttpServer server;
+
+ setUp(() async {
+ setCurrentLogWriter();
+ server = await startHttpServer('localhost', port: 0);
+ });
+
+ tearDown(() async {
+ await server.close();
+ });
+
+ test('emits HTTP_REQUEST_EXCEPTION event', () async {
+ Future<void> throwAsyncException() async {
+ await Future.delayed(const Duration(milliseconds: 100));
+ throw Exception('async error');
+ }
+
+ // The events stream is a broadcast stream so start listening
+ // before the action.
+ final events = expectLater(
+ pipe(eventStream),
+ emitsThrough(
+ matchesEvent(DwdsEventKind.httpRequestException, {
+ 'server': 'FakeServer',
+ 'exception': startsWith('Exception: async error'),
+ }),
+ ),
+ );
+
+ // Start serving requests with a failing handler in an error zone.
+ serveHttpRequests(
+ server,
+ (request) async {
+ unawaited(throwAsyncException());
+ return Future.error('error');
+ },
+ (e, s) {
+ emitEvent(DwdsEvent.httpRequestException('FakeServer', '$e:$s'));
+ },
+ );
+
+ // Send a request.
+ final client = HttpClient();
+ final request = await client.getUrl(
+ Uri.parse('http://localhost:${server.port}/foo'),
+ );
+
+ // Ignore the response.
+ final response = await request.close();
+ await response.drain();
+
+ // Wait for expected events.
+ await events;
+ });
+ });
+
+ testWithDwds(provider: provider);
+}
diff --git a/dwds/test/integration/events_test.dart b/dwds/test/integration/events_common.dart
similarity index 87%
rename from dwds/test/integration/events_test.dart
rename to dwds/test/integration/events_common.dart
index cb8e543..a9fd7e2 100644
--- a/dwds/test/integration/events_test.dart
+++ b/dwds/test/integration/events_common.dart
@@ -2,14 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@Timeout(Duration(minutes: 2))
-library;
-
import 'dart:async';
import 'dart:io';
import 'package:dwds/src/events.dart';
-import 'package:dwds/src/utilities/server.dart';
import 'package:test/test.dart';
import 'package:test_common/logging.dart';
import 'package:test_common/test_sdk_configuration.dart';
@@ -21,69 +17,12 @@
import 'fixtures/project.dart';
import 'fixtures/utilities.dart';
-void main() {
- final provider = TestSdkConfigurationProvider();
- tearDownAll(provider.dispose);
-
+void testWithDwds({
+ required TestSdkConfigurationProvider provider,
+ bool debug = false,
+}) {
final context = TestContext(TestProject.test, provider);
- group('serve requests', () {
- late HttpServer server;
-
- setUp(() async {
- setCurrentLogWriter();
- server = await startHttpServer('localhost', port: 0);
- });
-
- tearDown(() async {
- await server.close();
- });
-
- test('emits HTTP_REQUEST_EXCEPTION event', () async {
- Future<void> throwAsyncException() async {
- await Future.delayed(const Duration(milliseconds: 100));
- throw Exception('async error');
- }
-
- // The events stream is a broadcast stream so start listening
- // before the action.
- final events = expectLater(
- pipe(eventStream),
- emitsThrough(
- matchesEvent(DwdsEventKind.httpRequestException, {
- 'server': 'FakeServer',
- 'exception': startsWith('Exception: async error'),
- }),
- ),
- );
-
- // Start serving requests with a failing handler in an error zone.
- serveHttpRequests(
- server,
- (request) async {
- unawaited(throwAsyncException());
- return Future.error('error');
- },
- (e, s) {
- emitEvent(DwdsEvent.httpRequestException('FakeServer', '$e:$s'));
- },
- );
-
- // Send a request.
- final client = HttpClient();
- final request = await client.getUrl(
- Uri.parse('http://localhost:${server.port}/foo'),
- );
-
- // Ignore the response.
- final response = await request.close();
- await response.drain();
-
- // Wait for expected events.
- await events;
- });
- });
-
group(
'with dwds',
() {
@@ -129,7 +68,7 @@
}
setUpAll(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
initialEvents = expectLater(
pipe(eventStream, timeout: const Timeout.factor(5)),
emitsThrough(
@@ -140,7 +79,12 @@
),
);
await context.setUp(
- testSettings: TestSettings(enableExpressionEvaluation: true),
+ testSettings: TestSettings(
+ enableExpressionEvaluation: true,
+ moduleFormat: provider.ddcModuleFormat,
+ verboseCompiler: debug,
+ canaryFeatures: provider.canaryFeatures,
+ ),
debugSettings: TestDebugSettings.withDevToolsLaunch(context),
);
keyboard = context.webDriver.driver.keyboard;
@@ -201,7 +145,7 @@
late String bootstrapId;
setUpAll(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
service = context.service;
final vm = await service.getVM();
final isolate = await service.getIsolate(vm.isolates!.first.id!);
@@ -210,7 +154,7 @@
});
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
});
test('emits EVALUATE events on evaluation success', () async {
@@ -250,7 +194,7 @@
late ScriptRef mainScript;
setUpAll(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
service = context.service;
final vm = await service.getVM();
@@ -264,7 +208,7 @@
});
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
});
test('emits EVALUATE_IN_FRAME events on RPC error', () async {
@@ -362,7 +306,7 @@
late ScriptRef mainScript;
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
service = context.service;
final vm = await service.getVM();
isolateId = vm.isolates!.first.id!;
@@ -390,7 +334,7 @@
late String isolateId;
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
service = context.service;
final vm = await service.getVM();
isolateId = vm.isolates!.first.id!;
@@ -411,7 +355,7 @@
late String isolateId;
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
service = context.service;
final vm = await service.getVM();
isolateId = vm.isolates!.first.id!;
@@ -429,7 +373,7 @@
group('getVM', () {
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
});
test('emits GET_VM events', () async {
@@ -444,7 +388,7 @@
group('hotRestart', () {
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
});
test('emits HOT_RESTART event', () async {
@@ -466,7 +410,7 @@
late String isolateId;
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
service = context.service;
final vm = await service.getVM();
isolateId = vm.isolates!.first.id!;
@@ -511,7 +455,7 @@
group('fullReload', () {
setUp(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
});
test('emits FULL_RELOAD event', () async {
diff --git a/dwds/test/integration/events_ddc_library_bundle_test.dart b/dwds/test/integration/events_ddc_library_bundle_test.dart
new file mode 100644
index 0000000..bd502d3
--- /dev/null
+++ b/dwds/test/integration/events_ddc_library_bundle_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2026, 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 file.
+
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:dwds/expression_compiler.dart';
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'events_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+ final canary = true;
+ final provider = TestSdkConfigurationProvider(
+ verbose: debug,
+ canaryFeatures: canary,
+ ddcModuleFormat: ModuleFormat.ddc,
+ );
+ tearDownAll(provider.dispose);
+
+ testWithDwds(provider: provider, debug: debug);
+}
diff --git a/dwds/test/integration/frontend_server_breakpoint_test.dart b/dwds/test/integration/frontend_server_breakpoint_test.dart
index d1f9fe5..24b2414 100644
--- a/dwds/test/integration/frontend_server_breakpoint_test.dart
+++ b/dwds/test/integration/frontend_server_breakpoint_test.dart
@@ -38,6 +38,7 @@
testSettings: TestSettings(
compilationMode: CompilationMode.frontendServer,
verboseCompiler: verboseCompiler,
+ canaryFeatures: provider.canaryFeatures,
),
);
});
diff --git a/dwds/test/integration/handlers/asset_handler_amd_test.dart b/dwds/test/integration/handlers/asset_handler_amd_test.dart
new file mode 100644
index 0000000..3ae5141
--- /dev/null
+++ b/dwds/test/integration/handlers/asset_handler_amd_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2026, 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 file.
+
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'asset_handler_common.dart';
+
+void main() {
+ final provider = TestSdkConfigurationProvider();
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider);
+}
diff --git a/dwds/test/integration/handlers/asset_handler_test.dart b/dwds/test/integration/handlers/asset_handler_common.dart
similarity index 87%
rename from dwds/test/integration/handlers/asset_handler_test.dart
rename to dwds/test/integration/handlers/asset_handler_common.dart
index acde979..97bb49f 100644
--- a/dwds/test/integration/handlers/asset_handler_test.dart
+++ b/dwds/test/integration/handlers/asset_handler_common.dart
@@ -2,9 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@Timeout(Duration(minutes: 2))
-library;
-
import 'package:shelf/shelf.dart';
import 'package:test/test.dart';
import 'package:test_common/logging.dart';
@@ -14,27 +11,30 @@
import '../fixtures/project.dart';
import '../fixtures/utilities.dart';
-void main() {
+void testAll({
+ required TestSdkConfigurationProvider provider,
+ bool debug = false,
+}) {
group('Asset handler', () {
- final provider = TestSdkConfigurationProvider();
final context = TestContext(TestProject.test, provider);
setUpAll(() async {
- setCurrentLogWriter();
+ setCurrentLogWriter(debug: debug);
await context.setUp(
testSettings: TestSettings(
enableExpressionEvaluation: true,
- verboseCompiler: false,
+ verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
),
);
});
tearDownAll(() async {
await context.tearDown();
- provider.dispose();
});
- setUp(setCurrentLogWriter);
+ setUp(() => setCurrentLogWriter(debug: debug));
Future<void> readAsString(String path) async {
final request = Request('GET', Uri.parse('http://foo:0000/$path'));
diff --git a/dwds/test/integration/handlers/asset_handler_ddc_library_bundle_test.dart b/dwds/test/integration/handlers/asset_handler_ddc_library_bundle_test.dart
new file mode 100644
index 0000000..2f29670
--- /dev/null
+++ b/dwds/test/integration/handlers/asset_handler_ddc_library_bundle_test.dart
@@ -0,0 +1,26 @@
+// Copyright (c) 2026, 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 file.
+
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:dwds/expression_compiler.dart';
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'asset_handler_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+ final canary = true;
+ final provider = TestSdkConfigurationProvider(
+ verbose: debug,
+ canaryFeatures: canary,
+ ddcModuleFormat: ModuleFormat.ddc,
+ );
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider, debug: debug);
+}
diff --git a/dwds/test/integration/instances/common/instance_common.dart b/dwds/test/integration/instances/common/instance_common.dart
index 7cbc17b..392e83a 100644
--- a/dwds/test/integration/instances/common/instance_common.dart
+++ b/dwds/test/integration/instances/common/instance_common.dart
@@ -33,6 +33,7 @@
await context.setUp(
testSettings: TestSettings(
compilationMode: compilationMode,
+ verboseCompiler: debug,
canaryFeatures: canaryFeatures,
),
);
@@ -95,6 +96,7 @@
await context.setUp(
testSettings: TestSettings(
compilationMode: compilationMode,
+ verboseCompiler: debug,
canaryFeatures: canaryFeatures,
moduleFormat: provider.ddcModuleFormat,
),
diff --git a/dwds/test/integration/refresh_amd_test.dart b/dwds/test/integration/refresh_amd_test.dart
new file mode 100644
index 0000000..67fd5d2
--- /dev/null
+++ b/dwds/test/integration/refresh_amd_test.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2026, 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 file.
+
+/// Tests that require a fresh context to run, and can interfere with other
+/// tests.
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'refresh_common.dart';
+
+void main() {
+ final provider = TestSdkConfigurationProvider();
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider);
+}
diff --git a/dwds/test/integration/refresh_test.dart b/dwds/test/integration/refresh_common.dart
similarity index 83%
rename from dwds/test/integration/refresh_test.dart
rename to dwds/test/integration/refresh_common.dart
index 3d7cf92..5cad998 100644
--- a/dwds/test/integration/refresh_test.dart
+++ b/dwds/test/integration/refresh_common.dart
@@ -2,33 +2,36 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/// Tests that require a fresh context to run, and can interfere with other
-/// tests.
-@TestOn('vm')
-@Timeout(Duration(minutes: 2))
-library;
-
import 'dart:async';
import 'package:test/test.dart';
+import 'package:test_common/logging.dart';
import 'package:test_common/test_sdk_configuration.dart';
import 'package:vm_service/vm_service.dart';
import 'package:vm_service_interface/vm_service_interface.dart';
import 'fixtures/context.dart';
import 'fixtures/project.dart';
+import 'fixtures/utilities.dart';
-void main() {
- final provider = TestSdkConfigurationProvider();
- tearDownAll(provider.dispose);
-
+void testAll({
+ required TestSdkConfigurationProvider provider,
+ bool debug = false,
+}) {
final context = TestContext(TestProject.test, provider);
group('fresh context', () {
late VmServiceInterface service;
late VM vm;
setUpAll(() async {
- await context.setUp();
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
+ ),
+ );
service = context.service;
vm = await service.getVM();
});
diff --git a/dwds/test/integration/refresh_ddc_library_bundle_test.dart b/dwds/test/integration/refresh_ddc_library_bundle_test.dart
new file mode 100644
index 0000000..9faedee
--- /dev/null
+++ b/dwds/test/integration/refresh_ddc_library_bundle_test.dart
@@ -0,0 +1,30 @@
+// Copyright (c) 2026, 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 file.
+
+/// Tests that require a fresh context to run, and can interfere with other
+/// tests.
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:dwds/expression_compiler.dart';
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'refresh_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+
+ final canary = true;
+ final provider = TestSdkConfigurationProvider(
+ verbose: debug,
+ canaryFeatures: canary,
+ ddcModuleFormat: ModuleFormat.ddc,
+ );
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider, debug: debug);
+}
diff --git a/dwds/test/integration/screenshot_amd_test.dart b/dwds/test/integration/screenshot_amd_test.dart
new file mode 100644
index 0000000..01e4f3d
--- /dev/null
+++ b/dwds/test/integration/screenshot_amd_test.dart
@@ -0,0 +1,18 @@
+// Copyright (c) 2026, 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 file.
+
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'screenshot_common.dart';
+
+void main() {
+ final provider = TestSdkConfigurationProvider();
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider);
+}
diff --git a/dwds/test/integration/screenshot_test.dart b/dwds/test/integration/screenshot_common.dart
similarity index 64%
rename from dwds/test/integration/screenshot_test.dart
rename to dwds/test/integration/screenshot_common.dart
index fe999cd..a85802a 100644
--- a/dwds/test/integration/screenshot_test.dart
+++ b/dwds/test/integration/screenshot_common.dart
@@ -2,23 +2,29 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@Timeout(Duration(minutes: 2))
-library;
-
import 'package:test/test.dart';
+import 'package:test_common/logging.dart';
import 'package:test_common/test_sdk_configuration.dart';
import 'fixtures/context.dart';
import 'fixtures/project.dart';
+import 'fixtures/utilities.dart';
-void main() {
- final provider = TestSdkConfigurationProvider();
- tearDownAll(provider.dispose);
-
+void testAll({
+ required TestSdkConfigurationProvider provider,
+ bool debug = false,
+}) {
final context = TestContext(TestProject.test, provider);
setUpAll(() async {
- await context.setUp();
+ setCurrentLogWriter(debug: debug);
+ await context.setUp(
+ testSettings: TestSettings(
+ verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
+ ),
+ );
});
tearDownAll(() async {
diff --git a/dwds/test/integration/screenshot_ddc_library_bundle_test.dart b/dwds/test/integration/screenshot_ddc_library_bundle_test.dart
new file mode 100644
index 0000000..9990d84
--- /dev/null
+++ b/dwds/test/integration/screenshot_ddc_library_bundle_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2026, 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 file.
+
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:dwds/expression_compiler.dart';
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'screenshot_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+
+ final canary = true;
+ final provider = TestSdkConfigurationProvider(
+ verbose: debug,
+ canaryFeatures: canary,
+ ddcModuleFormat: ModuleFormat.ddc,
+ );
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider, debug: debug);
+}
diff --git a/dwds/test/integration/variable_scope_amd_test.dart b/dwds/test/integration/variable_scope_amd_test.dart
new file mode 100644
index 0000000..a7bee9b
--- /dev/null
+++ b/dwds/test/integration/variable_scope_amd_test.dart
@@ -0,0 +1,22 @@
+// Copyright (c) 2026, 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 file.
+
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'variable_scope_common.dart';
+
+void main() {
+ // set to true for debug logging.
+ const debug = false;
+
+ final provider = TestSdkConfigurationProvider(verbose: debug);
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider, debug: debug);
+}
diff --git a/dwds/test/integration/variable_scope_test.dart b/dwds/test/integration/variable_scope_common.dart
similarity index 96%
rename from dwds/test/integration/variable_scope_test.dart
rename to dwds/test/integration/variable_scope_common.dart
index 14bd0cf..6333ad5 100644
--- a/dwds/test/integration/variable_scope_test.dart
+++ b/dwds/test/integration/variable_scope_common.dart
@@ -2,9 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@TestOn('vm')
-@Timeout(Duration(minutes: 2))
-library;
+import 'dart:async';
import 'package:dwds/src/debugging/dart_scope.dart';
import 'package:dwds/src/services/chrome/chrome_proxy_service.dart';
@@ -17,18 +15,21 @@
import 'fixtures/project.dart';
import 'fixtures/utilities.dart';
-void main() {
- // set to true for debug logging.
- const debug = false;
-
- final provider = TestSdkConfigurationProvider(verbose: debug);
- tearDownAll(provider.dispose);
-
+void testAll({
+ required TestSdkConfigurationProvider provider,
+ bool debug = false,
+}) {
final context = TestContext(TestProject.testScopes, provider);
setUpAll(() async {
setCurrentLogWriter(debug: debug);
- await context.setUp(testSettings: TestSettings(verboseCompiler: debug));
+ await context.setUp(
+ testSettings: TestSettings(
+ verboseCompiler: debug,
+ moduleFormat: provider.ddcModuleFormat,
+ canaryFeatures: provider.canaryFeatures,
+ ),
+ );
});
tearDownAll(() async {
diff --git a/dwds/test/integration/variable_scope_ddc_library_bundle_test.dart b/dwds/test/integration/variable_scope_ddc_library_bundle_test.dart
new file mode 100644
index 0000000..7467e8d
--- /dev/null
+++ b/dwds/test/integration/variable_scope_ddc_library_bundle_test.dart
@@ -0,0 +1,28 @@
+// Copyright (c) 2026, 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 file.
+
+@TestOn('vm')
+@Timeout(Duration(minutes: 2))
+library;
+
+import 'package:dwds/expression_compiler.dart';
+import 'package:test/test.dart';
+import 'package:test_common/test_sdk_configuration.dart';
+
+import 'variable_scope_common.dart';
+
+void main() {
+ // Enable verbose logging for debugging.
+ const debug = false;
+
+ final canary = true;
+ final provider = TestSdkConfigurationProvider(
+ verbose: debug,
+ canaryFeatures: canary,
+ ddcModuleFormat: ModuleFormat.ddc,
+ );
+ tearDownAll(provider.dispose);
+
+ testAll(provider: provider, debug: debug);
+}