[gardening/test] Cleanup AOT checks in tests
Change-Id: I5235c5ba9824f72806214528ed86ecca2f3a7630 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/352863 Auto-Submit: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
committed by
Commit Queue
parent
ee39f45f76
commit
ca9eb4af0f
@@ -6,13 +6,14 @@ import "dart:async";
|
||||
import "dart:io";
|
||||
import "dart:convert";
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import 'use_flag_test_helper.dart';
|
||||
|
||||
main(List<String> args) async {
|
||||
if (!Platform.executable.endsWith("dart_precompiled_runtime")) {
|
||||
if (!isVmAotConfiguration) {
|
||||
return; // Running in JIT: AOT binaries not available.
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import "dart:async";
|
||||
import "dart:io";
|
||||
import "dart:convert";
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:test/test.dart';
|
||||
@@ -13,7 +14,7 @@ import 'package:test/test.dart';
|
||||
import 'use_flag_test_helper.dart';
|
||||
|
||||
main(List<String> args) async {
|
||||
if (!Platform.executable.endsWith("dart_precompiled_runtime")) {
|
||||
if (!isVmAotConfiguration) {
|
||||
return; // Running in JIT: AOT binaries not available.
|
||||
}
|
||||
|
||||
|
||||
@@ -12,18 +12,17 @@ import 'dart:io';
|
||||
import 'dart:isolate';
|
||||
import 'dart:_internal' show VMInternalsForTesting;
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
const int isolateCount = 3;
|
||||
const int deoptIsolateId = 0;
|
||||
const int polyIsolateId = 1;
|
||||
|
||||
final bool isAOT = Platform.executable.contains('dart_precompiled_runtime');
|
||||
|
||||
main() async {
|
||||
// This test will cause deoptimizations (via helper in `dart:_internal`) and
|
||||
// does therefore not run in AOT.
|
||||
if (isAOT) return;
|
||||
if (isVmAotConfiguration) return;
|
||||
|
||||
final onExit = ReceivePort();
|
||||
final onError = ReceivePort()
|
||||
|
||||
@@ -7,15 +7,16 @@ import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import '../../../../../pkg/front_end/test/tool/reload.dart';
|
||||
|
||||
export '../snapshot_test_helper.dart' show withTempDir;
|
||||
|
||||
bool get currentVmSupportsReload {
|
||||
final executable = Platform.executable;
|
||||
return !executable.contains('Product') &&
|
||||
!executable.contains('dart_precompiled_runtime');
|
||||
return !executable.contains('Product') && !isVmAotConfiguration;
|
||||
}
|
||||
|
||||
bool get runningInSimulator {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
import 'use_flag_test_helper.dart';
|
||||
@@ -58,8 +59,6 @@ void main(List<String> args) async {
|
||||
return;
|
||||
}
|
||||
|
||||
final bool isAot = Platform.executable.contains('dart_precompiled_runtime');
|
||||
|
||||
await withTempDir('tts', (String temp) async {
|
||||
final script = path.join(temp, 'script.dart');
|
||||
await File(script).writeAsString(generateExample());
|
||||
@@ -69,7 +68,7 @@ void main(List<String> args) async {
|
||||
// binaries).
|
||||
final scriptDill = path.join(temp, 'script.dart.dill');
|
||||
await run('pkg/vm/tool/gen_kernel', <String>[
|
||||
isAot ? '--aot' : '--no-aot',
|
||||
isVmAotConfiguration ? '--aot' : '--no-aot',
|
||||
'--platform=$platformDill',
|
||||
'-o',
|
||||
scriptDill,
|
||||
@@ -77,7 +76,7 @@ void main(List<String> args) async {
|
||||
]);
|
||||
|
||||
String mainFile = scriptDill;
|
||||
if (isAot) {
|
||||
if (isVmAotConfiguration) {
|
||||
final elfFile = path.join(temp, 'script.dart.dill.elf');
|
||||
await run(genSnapshot, <String>[
|
||||
'--snapshot-kind=app-aot-elf',
|
||||
|
||||
@@ -8,15 +8,15 @@ import 'dart:_internal';
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
|
||||
const address = 0xaabbccdd;
|
||||
bool deoptimize = false;
|
||||
|
||||
final bool isAOT = Platform.executable.contains('dart_precompiled_runtime');
|
||||
|
||||
main() {
|
||||
// This test will cause deoptimizations (via helper in `dart:_internal`) and
|
||||
// does therefore not run in AOT.
|
||||
if (isAOT) return;
|
||||
if (isVmAotConfiguration) return;
|
||||
|
||||
for (int i = 0; i < 100000; ++i) {
|
||||
foo();
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
final isAOTRuntime = path.basenameWithoutExtension(Platform.executable) ==
|
||||
'dart_precompiled_runtime';
|
||||
final isAOTRuntime = isVmAotConfiguration;
|
||||
final buildDir = path.dirname(Platform.executable);
|
||||
final sdkDir = path.dirname(path.dirname(buildDir));
|
||||
late final platformDill = () {
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:native_stack_traces/native_stack_traces.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
@@ -58,8 +59,7 @@ Future<void> main() async {
|
||||
rawStack = st.toString();
|
||||
}
|
||||
|
||||
if (path.basenameWithoutExtension(Platform.executable) !=
|
||||
"dart_precompiled_runtime") {
|
||||
if (!isVmAotConfiguration) {
|
||||
return; // Not running from an AOT compiled snapshot.
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:native_stack_traces/native_stack_traces.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
@@ -31,8 +32,7 @@ Future<void> main() async {
|
||||
rawStack = st.toString();
|
||||
}
|
||||
|
||||
if (path.basenameWithoutExtension(Platform.executable) !=
|
||||
"dart_precompiled_runtime") {
|
||||
if (!isVmAotConfiguration) {
|
||||
return; // Not running from an AOT compiled snapshot.
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,10 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:expect/config.dart';
|
||||
import 'package:expect/expect.dart';
|
||||
import 'package:native_stack_traces/native_stack_traces.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
import 'package:expect/expect.dart';
|
||||
|
||||
@pragma("vm:prefer-inline")
|
||||
bar() {
|
||||
@@ -31,8 +32,7 @@ Future<void> main() async {
|
||||
rawStack = st.toString();
|
||||
}
|
||||
|
||||
if (path.basenameWithoutExtension(Platform.executable) !=
|
||||
"dart_precompiled_runtime") {
|
||||
if (!isVmAotConfiguration) {
|
||||
return; // Not running from an AOT compiled snapshot.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user