Files
sdk/runtime/tests/vm/dart/split_aot_kernel_generation_test.dart
T
Alexander Markov 3350455f97 [tests/nnbd] Pass null safety options to gen_kernel in vm tests
runGenKernel helper function now passes all null safety options to
gen_kernel tool implicitly, so callers don't bother.

runGenKernelWithoutStandardOptions helper is added in case those
options should not be passed (e.g. for null safety autodetection test).

This change fixes vm/dart/minimal_kernel_test and
vm/dart/bytecode_and_ast_mix_test tests (with null-safe package:path).

Change-Id: I772f715c1c84362f8a1c96e6f77cb8423f6743ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155066
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-07-21 03:38:24 +00:00

49 lines
1.4 KiB
Dart

// Copyright (c) 2020, 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.
// OtherResources=splay_test.dart
// Tests AOT kernel generation split into 2 steps using '--from-dill' option.
import 'dart:io' show Platform;
import 'package:path/path.dart' as path;
import 'snapshot_test_helper.dart';
Future<void> runSplitAOTKernelGenerationTest(Uri testScriptUri) async {
await withTempDir((String temp) async {
final intermediateDillPath = path.join(temp, 'intermediate.dill');
final outputDillPath = path.join(temp, 'output.dill');
final snapshotPath = path.join(temp, 'aot.snapshot');
await runGenKernel('BUILD INTERMEDIATE DILL FILE', [
'--no-aot',
'--link-platform',
'--output=$intermediateDillPath',
testScriptUri.toFilePath(),
]);
await runGenKernel('BUILD FINAL DILL FILE', [
'--aot',
'--from-dill=$intermediateDillPath',
'--link-platform',
'--output=$outputDillPath',
testScriptUri.toFilePath(),
]);
await runGenSnapshot('GENERATE SNAPSHOT', [
'--snapshot-kind=app-aot-elf',
'--elf=$snapshotPath',
outputDillPath,
]);
await runBinary('RUN SNAPSHOT', dartPrecompiledRuntime, [snapshotPath]);
});
}
main() async {
await runSplitAOTKernelGenerationTest(
Platform.script.resolve('splay_test.dart'));
}