@@ -22,6 +22,7 @@ import '../src/fakes.dart';
2222void main () {
2323 late ResidentCompiler generator;
2424 late ResidentCompiler generatorWithScheme;
25+ late ResidentCompiler generatorWithPlatformDillAndLibrariesSpec;
2526 late MemoryIOSink frontendServerStdIn;
2627 late BufferLogger testLogger;
2728 late StdoutHandler generatorStdoutHandler;
@@ -76,6 +77,18 @@ void main() {
7677 fileSystem: MemoryFileSystem .test (),
7778 stdoutHandler: generatorWithSchemeStdoutHandler,
7879 );
80+ generatorWithPlatformDillAndLibrariesSpec = DefaultResidentCompiler (
81+ 'sdkroot' ,
82+ buildMode: BuildMode .debug,
83+ logger: testLogger,
84+ processManager: fakeProcessManager,
85+ artifacts: Artifacts .test (),
86+ platform: FakePlatform (),
87+ fileSystem: MemoryFileSystem .test (),
88+ stdoutHandler: generatorStdoutHandler,
89+ platformDill: '/foo/platform.dill' ,
90+ librariesSpec: '/bar/libraries.json' ,
91+ );
7992 });
8093
8194 testWithoutContext ('incremental compile single dart compile' , () async {
@@ -431,6 +444,32 @@ void main() {
431444 expect (output? .outputFilename, equals ('/path/to/main.dart.dill' ));
432445 expect (fakeProcessManager, hasNoRemainingExpectations);
433446 });
447+
448+ testWithoutContext ('compile does not pass libraries-spec when using a platform dill' , () async {
449+ fakeProcessManager.addCommand (FakeCommand (
450+ command: const < String > [
451+ ...frontendServerCommand,
452+ '--platform' ,
453+ '/foo/platform.dill' ,
454+ '--verbosity=error'
455+ ],
456+ stdout: 'result abc\n line1\n line2\n abc\n abc /path/to/main.dart.dill 0' ,
457+ stdin: frontendServerStdIn,
458+ ));
459+
460+ final CompilerOutput ? output = await generatorWithPlatformDillAndLibrariesSpec.recompile (
461+ Uri .parse ('/path/to/main.dart' ),
462+ null /* invalidatedFiles */ ,
463+ outputPath: '/build/' ,
464+ packageConfig: PackageConfig .empty,
465+ fs: MemoryFileSystem (),
466+ projectRootPath: '' ,
467+ );
468+ expect (frontendServerStdIn.getAndClear (), 'compile /path/to/main.dart\n ' );
469+ expect (testLogger.errorText, equals ('line1\n line2\n ' ));
470+ expect (output? .outputFilename, equals ('/path/to/main.dart.dill' ));
471+ expect (fakeProcessManager, hasNoRemainingExpectations);
472+ });
434473}
435474
436475Future <void > _recompile (
0 commit comments