b17e8ca9f7
This test runs gen_kernel tool to compile itself with global optimizations enabled. Such compilation is quite slow by itself, and in various modes such as debug mode or hot-reload testing mode it takes even more time and causes flaky timeouts on various bots. This change replaces script being compiled with a small Dart script. Also, the test is filtered on various slow configurations. Fixes https://github.com/dart-lang/sdk/issues/41352 Change-Id: I45a6c7965f3ad84f75e4aa1315c9a3d00ea97cb4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142553 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
38 lines
1.1 KiB
Dart
38 lines
1.1 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=minimal_kernel_script.dart
|
|
|
|
// Tests that dill file produced with --minimal-kernel option
|
|
// works as expected.
|
|
|
|
import 'dart:io' show Platform;
|
|
|
|
import 'package:path/path.dart' as path;
|
|
import 'snapshot_test_helper.dart';
|
|
|
|
compileAndRunMinimalDillTest(List<String> extraCompilationArgs) async {
|
|
final testScriptUri = Platform.script.resolve('minimal_kernel_script.dart');
|
|
final message = 'Round_trip_message';
|
|
|
|
await withTempDir((String temp) async {
|
|
final minimalDillPath = path.join(temp, 'minimal.dill');
|
|
await runGenKernel('BUILD MINIMAL DILL FILE', [
|
|
'--minimal-kernel',
|
|
'--no-link-platform',
|
|
...extraCompilationArgs,
|
|
'--output=$minimalDillPath',
|
|
testScriptUri.toFilePath(),
|
|
]);
|
|
|
|
final result =
|
|
await runDart('RUN FROM MINIMAL DILL FILE', [minimalDillPath, message]);
|
|
expectOutput(message, result);
|
|
});
|
|
}
|
|
|
|
main() async {
|
|
await compileAndRunMinimalDillTest([]);
|
|
}
|