Skip to content

Add package config URI into VM test entrypoints #2245

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 8 commits into from
Jun 27, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add to precompiled tests
  • Loading branch information
natebosch committed Jun 17, 2024
commit 9bb4a2cc686feccfba97885ab3f7a87b45bed2e5
8 changes: 6 additions & 2 deletions pkgs/test_core/lib/src/runner/vm/test_compiler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'dart:isolate';

import 'package:async/async.dart';
import 'package:frontend_server_client/frontend_server_client.dart';
Expand Down Expand Up @@ -85,7 +86,7 @@ class _TestCompilerForLanguageVersion {
: _dillCachePath = '$dillCachePrefix.'
'${_dillCacheSuffix(_languageVersionComment, enabledExperiments)}';

String _generateEntrypoint(Uri testUri) {
String _generateEntrypoint(Uri testUri, Uri? packageConfigUri) {
return '''
$_languageVersionComment
import "dart:isolate";
Expand All @@ -94,6 +95,8 @@ class _TestCompilerForLanguageVersion {

import "$testUri" as test;

const packageConfigLocation = '$packageConfigUri';

void main(_, SendPort sendPort) {
internalBootstrapVmTest(() => test.main, sendPort);
}
Expand All @@ -108,7 +111,8 @@ class _TestCompilerForLanguageVersion {
if (_closeMemo.hasRun) return CompilationResponse._wasShutdown;
CompileResult? compilerOutput;
final tempFile = File(p.join(_outputDillDirectory.path, 'test.dart'))
..writeAsStringSync(_generateEntrypoint(mainUri));
..writeAsStringSync(
_generateEntrypoint(mainUri, await Isolate.packageConfig));
final testCache = File(_dillCachePath);

try {
Expand Down
Loading