Skip to content

Run dwds tests in a copy of the sdk directory #1989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Feb 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions dwds/test/build_daemon_breakpoint_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
@TestOn('vm')
@Timeout(Duration(minutes: 2))

import 'package:dwds/src/services/chrome_proxy_service.dart';
import 'package:test/test.dart';
import 'package:test_common/test_sdk_configuration.dart';
import 'package:vm_service/vm_service.dart';

import 'fixtures/context.dart';
import 'fixtures/project.dart';

final context = TestContext(TestProject.testPackageWithSoundNullSafety());
void main() {
final provider = TestSdkConfigurationProvider();
tearDownAll(provider.dispose);

ChromeProxyService get service => context.service;
final context =
TestContext(TestProject.testPackageWithSoundNullSafety(), provider);

void main() {
group('shared context', () {
setUpAll(() async {
await context.setUp();
Expand All @@ -34,8 +36,10 @@ void main() {
late ScriptRef mainScript;
late String mainScriptUri;
late Stream<Event> stream;
late VmServiceInterface service;

setUp(() async {
service = context.service;
vm = await service.getVM();
isolate = await service.getIsolate(vm.isolates!.first.id!);
isolateId = isolate.id!;
Expand Down
12 changes: 7 additions & 5 deletions dwds/test/build_daemon_callstack_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,19 @@

@TestOn('vm')
@Timeout(Duration(minutes: 2))
import 'dart:async';

import 'package:dwds/src/services/chrome_proxy_service.dart';
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 'fixtures/context.dart';
import 'fixtures/project.dart';

void main() {
final provider = TestSdkConfigurationProvider();
tearDownAll(provider.dispose);

group(
'shared context |',
() {
Expand All @@ -24,7 +26,7 @@ void main() {
for (var nullSafety in NullSafety.values) {
group('${nullSafety.name} null safety |', () {
final project = TestProject.testPackage(nullSafety: nullSafety);
final context = TestContext(project);
final context = TestContext(project, provider);

setUpAll(() async {
setCurrentLogWriter(debug: debug);
Expand All @@ -40,7 +42,7 @@ void main() {
});

group('callStack |', () {
late ChromeProxyService service;
late VmServiceInterface service;
VM vm;
late Isolate isolate;
ScriptList scripts;
Expand All @@ -58,7 +60,7 @@ void main() {
await service.streamListen('Debug');
stream = service.onEvent('Debug');

final testPackage = project.packageName;
final testPackage = context.project.packageName;
mainScript = scripts.scripts!
.firstWhere((each) => each.uri!.contains('main.dart'));
testLibraryScript = scripts.scripts!.firstWhere((each) =>
Expand Down
5 changes: 5 additions & 0 deletions dwds/test/build_daemon_circular_evaluate_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@Timeout(Duration(minutes: 2))

import 'package:test/test.dart';
import 'package:test_common/test_sdk_configuration.dart';

import 'evaluate_circular_common.dart';
import 'fixtures/context.dart';
Expand All @@ -15,9 +16,13 @@ void main() async {
// Enable verbose logging for debugging.
final debug = false;

final provider = TestSdkConfigurationProvider(verbose: debug);
tearDownAll(provider.dispose);

for (var nullSafety in NullSafety.values) {
group('${nullSafety.name} null safety |', () {
testAll(
provider: provider,
compilationMode: CompilationMode.buildDaemon,
nullSafety: nullSafety,
debug: debug,
Expand Down
5 changes: 5 additions & 0 deletions dwds/test/build_daemon_evaluate_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
@Timeout(Duration(minutes: 2))

import 'package:test/test.dart';
import 'package:test_common/test_sdk_configuration.dart';

import 'evaluate_common.dart';
import 'fixtures/context.dart';
Expand All @@ -15,9 +16,13 @@ void main() async {
// Enable verbose logging for debugging.
final debug = false;

final provider = TestSdkConfigurationProvider(verbose: debug);
tearDownAll(provider.dispose);

for (var nullSafety in NullSafety.values) {
group('${nullSafety.name} null safety |', () {
testAll(
provider: provider,
compilationMode: CompilationMode.buildDaemon,
nullSafety: nullSafety,
debug: debug,
Expand Down
Loading