Distinguish test executable name and its Soong module name
Besides making it easier to locate the test executable, this addresses
an issue that sometimes the executable cannot be located in some setup.
Bug: 204210910
Test: abtd (see result in the bug)
Change-Id: Ia03578ad0a84dd207a5d53766332715982304a73
diff --git a/authfs/tests/Android.bp b/authfs/tests/Android.bp
index 88c1ba6..92fa428 100644
--- a/authfs/tests/Android.bp
+++ b/authfs/tests/Android.bp
@@ -14,7 +14,7 @@
"VirtualizationTestHelper",
],
test_suites: ["general-tests"],
- target_required: ["open_then_run"],
+ target_required: ["open_then_run_module"],
data: [
":authfs_test_files",
":MicrodroidTestApp.signed",
@@ -22,7 +22,16 @@
}
rust_test {
- name: "open_then_run",
+ // PushFilePreparer can sometimes push the directory (if named "open_then_run", which contains
+ // the actual executable in a per-architecture sub-directory) instead of the executable. This
+ // makes it harder to use because the host Java test have to detect the executable path
+ // dynamically, e.g. if it's a directory, append the device's architecture to build the actual
+ // executable path. By simply renaming the module (thus the host directory), this forces
+ // PushFilePreparer to always push the executable to the destination, so that the Java test can
+ // easily locate the executable with a constant path.
+ name: "open_then_run_module",
+ stem: "open_then_run",
+
crate_name: "open_then_run",
srcs: ["open_then_run.rs"],
edition: "2018",