Skip to content

Commit

Permalink
[stable][testing] Support vm-aot configurations
Browse files Browse the repository at this point in the history
"vm-aot" is more user friendly than dart_precompiled-dartkp. But, "vm"
implied --runtime="vm" which is incompatible with --compiler="dartkp".

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/280094
Change-Id: Ia6d0e951818e17cc518a550d7ea9c93f21ddc8c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/289500
Reviewed-by: William Hesse <whesse@google.com>
  • Loading branch information
athomas committed Mar 17, 2023
1 parent fd7299c commit f1d319d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/smith/lib/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ class Configuration {

// Infer option values from the words in the configuration name.
var words = name.split("-").toSet();
// "vm-aot" -> "dart_precompiled-aot"
if (words.contains("aot")) {
words.remove("vm");
words.add("dart_precompiled");
}
var optionsCopy = Map.of(optionsJson);

T? enumOption<T extends NamedEnum>(
Expand Down
6 changes: 6 additions & 0 deletions pkg/test_runner/test/options_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ void testOptions() {
['-n', 'valid-dart2js-chrome,valid-dart2js-safari', '--no-batch'],
configuration.reproducingArguments);
}

// Allow vm-aot
configurations = parseConfigurations(['-nvm-aot']);
Expect.equals(1, configurations.length);
Expect.equals("dart_precompiled", configurations.first.runtime.name);
Expect.equals("dartkp", configurations.first.compiler.name);
}

void testValidation() {
Expand Down

0 comments on commit f1d319d

Please sign in to comment.