[go: nahoru, domu]

Skip to content

Commit

Permalink
[test] isVmAotConfiguration in custom configurations
Browse files Browse the repository at this point in the history
https://dart-review.googlesource.com/c/sdk/+/352863 standardized AOT
detection in tests. However, this didn't work for custom configs.
This wasn't caught on our CI, as the CI only uses predefined configs.

For custom configurations, fall back on the executable name to
determine the runtime. (Which is what the failing tests in the linked
issue used before the the referred CL.)

TEST=Manually tested.

Closes: #56041
Change-Id: I17ac731d2137020880defd254c3d006b55f7cf29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372260
Reviewed-by: Moritz Sümmermann <mosum@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
  • Loading branch information
dcharkes authored and Commit Queue committed Jun 19, 2024
1 parent 1a614b1 commit 4f8e653
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/smith/lib/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@ class Configuration {
nnbdMode ??= NnbdMode.strong;
sanitizer ??= Sanitizer.none;

// Infer runtime from executable.
if (runtime == null) {
final executableName = Uri.file(Platform.executable)
.pathSegments
.lastWhere((e) => e.isNotEmpty);
final executableNoExtension = executableName.split('.').first;
if (executableNoExtension == 'dart_precompiled_runtime') {
runtime = Runtime.dartPrecompiled;
}
// Don't infer anything from the `dart` executable. As multiple runtimes
// use that as executable.
}

// Infer from compiler from runtime or vice versa.
if (compiler == null) {
if (runtime == null) {
Expand Down

0 comments on commit 4f8e653

Please sign in to comment.