[testing] Support vm-aot configurations

"vm-aot" is more user friendly than dart_precompiled-dartkp. But, "vm" implied --runtime="vm" which is incompatible with --compiler="dartkp".

Bug: b/201271877
Change-Id: I19e6ccf77d2f56df5f3e27586c022a1810f7ef6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/280094
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
diff --git a/pkg/smith/lib/configuration.dart b/pkg/smith/lib/configuration.dart
index ec3167e..64e3552 100644
--- a/pkg/smith/lib/configuration.dart
+++ b/pkg/smith/lib/configuration.dart
@@ -115,6 +115,11 @@
 
     // 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>(
diff --git a/pkg/test_runner/test/options_test.dart b/pkg/test_runner/test/options_test.dart
index 9f5a401..ba771e7 100644
--- a/pkg/test_runner/test/options_test.dart
+++ b/pkg/test_runner/test/options_test.dart
@@ -67,6 +67,12 @@
         ['-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() {
diff --git a/pkg/test_runner/test/test_matrix.json b/pkg/test_runner/test/test_matrix.json
index 35fb980..3e88049 100644
--- a/pkg/test_runner/test/test_matrix.json
+++ b/pkg/test_runner/test/test_matrix.json
@@ -2,6 +2,11 @@
   "configurations": {
     "invalid-vm-android-simarm": {},
     "valid-dart2js-chrome": {},
-    "valid-dart2js-safari": {}
+    "valid-dart2js-safari": {},
+    "vm-aot": {
+      "options": {
+        "compiler": "dartkp"
+      }
+    }
   }
 }
\ No newline at end of file