summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Martin Stjernholm <mast@google.com> 2024-08-09 23:35:51 +0100
committer Martin Stjernholm <mast@google.com> 2024-08-13 17:09:38 +0000
commit649a2e6c1771a26bfacd00b0ee6c587361ebcdfd (patch)
treea50fda18ffdca97be67a5ef7d51b6554cbc8c95f
parent275cf7423efdb36e441b7bceb2e678944f8fa34b (diff)
Simplify test configs by disabling append-bitness and pushing the whole
test directory instead. Using append-bitness with FilePusher apparently disables pushing of the whole directory. If we remove it and push the test directory instead, we won't need to append bitness since it's added implicitly (and the test directory also has arch subdirectories). Without append-bitness we can also switch to PushFilePreparer, because that flag is the only difference between them. By pushing the whole test directory it's possible to clean up several cases where it was necessary to push other files with the tests. Test configs that invoke generate-boot-image on the device aren't so easy to fix this way, because we must expand the right path to the binary inside the test directory. Hence they're kept as-is for now. #codehealth Test: atest -a art_libnativebridge_cts_tests art_standalone_artd_tests \ art_standalone_cmdline_tests art_standalone_compiler_tests \ art_standalone_dex2oat_cts_tests art_standalone_dex2oat_tests \ art_standalone_dexdump_tests art_standalone_dexlist_tests \ art_standalone_dexopt_chroot_setup_tests \ art_standalone_dexoptanalyzer_tests art_standalone_dexpreopt_tests \ art_standalone_disassembler_tests art_standalone_libartbase_tests \ art_standalone_libartpalette_tests \ art_standalone_libartservice_tests art_standalone_libarttools_tests \ art_standalone_libdexfile_external_tests \ art_standalone_libdexfile_support_tests \ art_standalone_libdexfile_tests art_standalone_libprofile_tests \ art_standalone_oatdump_tests art_standalone_odrefresh_tests \ art_standalone_profman_tests art_standalone_runtime_tests \ art_standalone_sigchain_tests libnativeloader_lazy_test \ libnativeloader_test libnativebridge-tests Change-Id: I7c524a856821a5ee2b53d53e84793bf6527b970b
-rw-r--r--artd/art_standalone_artd_tests.xml13
-rw-r--r--dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml12
-rw-r--r--libdexfile/Android.bp1
-rw-r--r--libdexfile/art_standalone_libdexfile_tests.xml52
-rw-r--r--libnativebridge/tests/Android.bp1
-rw-r--r--libnativebridge/tests/libnativebridge-tests.xml41
-rw-r--r--libprofile/Android.bp1
-rw-r--r--libprofile/art_standalone_libprofile_tests.xml49
-rw-r--r--test/art-gtests-target-standalone-cts-template.xml7
-rw-r--r--test/art-gtests-target-standalone-non-multilib-template.xml7
-rw-r--r--test/art-gtests-target-standalone-template.xml7
-rw-r--r--test/dexpreopt/art_standalone_dexpreopt_tests.xml7
12 files changed, 18 insertions, 180 deletions
diff --git a/artd/art_standalone_artd_tests.xml b/artd/art_standalone_artd_tests.xml
index 00e0de9fd3..c132b010b1 100644
--- a/artd/art_standalone_artd_tests.xml
+++ b/artd/art_standalone_artd_tests.xml
@@ -19,20 +19,13 @@
<option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
<option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
- <option name="append-bitness" value="true" />
- </target_preparer>
-
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
- <option name="cleanup" value="true" />
- <option name="push" value="art-gtest-jars-Main.jar->/data/local/tmp/{MODULE}/art-gtest-jars-Main.jar" />
- <option name="push" value="art-gtest-jars-Nested.jar->/data/local/tmp/{MODULE}/art-gtest-jars-Nested.jar" />
+ <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
+ <option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="{MODULE}" />
</test>
diff --git a/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml b/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml
index ad37eb0104..e4ba301579 100644
--- a/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml
+++ b/dexopt_chroot_setup/art_standalone_dexopt_chroot_setup_tests.xml
@@ -24,19 +24,13 @@
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
<target_preparer class="com.android.tradefed.targetprep.DisableSELinuxTargetPreparer" />
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
- <option name="append-bitness" value="true" />
- </target_preparer>
-
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
- <option name="cleanup" value="true" />
- <option name="push" value="art-gtest-jars-Main.jar->/data/local/tmp/{MODULE}/art-gtest-jars-Main.jar" />
+ <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
+ <option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="{MODULE}" />
</test>
diff --git a/libdexfile/Android.bp b/libdexfile/Android.bp
index e18dd2d8ad..b9320b7dae 100644
--- a/libdexfile/Android.bp
+++ b/libdexfile/Android.bp
@@ -338,7 +338,6 @@ art_cc_test {
"art_standalone_gtest_defaults",
"art_libdexfile_tests_defaults",
],
- test_config: "art_standalone_libdexfile_tests.xml",
}
cc_library_headers {
diff --git a/libdexfile/art_standalone_libdexfile_tests.xml b/libdexfile/art_standalone_libdexfile_tests.xml
deleted file mode 100644
index 20a31ddd6f..0000000000
--- a/libdexfile/art_standalone_libdexfile_tests.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2021 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<configuration description="Runs art_standalone_libdexfile_tests.">
- <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
- <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
- <option name="cleanup" value="true" />
- <option name="push" value="art_standalone_libdexfile_tests->/data/local/tmp/art_standalone_libdexfile_tests/art_standalone_libdexfile_tests" />
- <option name="append-bitness" value="true" />
- </target_preparer>
-
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
- <option name="cleanup" value="true" />
- <option name="push" value="art-gtest-jars-GetMethodSignature.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-GetMethodSignature.jar" />
- <option name="push" value="art-gtest-jars-Lookup.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-Lookup.jar" />
- <option name="push" value="art-gtest-jars-Main.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-Main.jar" />
- <option name="push" value="art-gtest-jars-MainEmptyUncompressed.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-MainEmptyUncompressed.jar" />
- <option name="push" value="art-gtest-jars-MultiDex.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-MultiDex.jar" />
- <option name="push" value="art-gtest-jars-Nested.jar->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-Nested.jar" />
- <option name="push" value="art-gtest-jars-VerifierDeps.dex->/data/local/tmp/art_standalone_libdexfile_tests/art-gtest-jars-VerifierDeps.dex" />
- </target_preparer>
-
- <test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/art_standalone_libdexfile_tests" />
- <option name="module-name" value="art_standalone_libdexfile_tests" />
- </test>
-
- <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
- one of the Mainline modules below is present on the device used for testing. -->
- <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
- <!-- ART Mainline Module (internal version). -->
- <option name="mainline-module-package-name" value="com.google.android.art" />
- <!-- ART Mainline Module (external (AOSP) version). -->
- <option name="mainline-module-package-name" value="com.android.art" />
- </object>
-
- <!-- Only run tests if the device under test is SDK version 31 (Android 12) or above. -->
- <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
-</configuration>
diff --git a/libnativebridge/tests/Android.bp b/libnativebridge/tests/Android.bp
index 76c5e27104..8990cb59f9 100644
--- a/libnativebridge/tests/Android.bp
+++ b/libnativebridge/tests/Android.bp
@@ -106,7 +106,6 @@ cc_test {
],
isolated: true,
- test_config: "libnativebridge-tests.xml",
srcs: [
"NativeBridgeTest.cpp",
diff --git a/libnativebridge/tests/libnativebridge-tests.xml b/libnativebridge/tests/libnativebridge-tests.xml
deleted file mode 100644
index d4266a7d0c..0000000000
--- a/libnativebridge/tests/libnativebridge-tests.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2021 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<configuration description="Runs libnativebridge-tests.">
- <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
- <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
-
- <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
- <option name="cleanup" value="true" />
- <option name="push" value="libnativebridge-tests->/data/local/tmp/libnativebridge-tests" />
- </target_preparer>
-
- <test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp" />
- <option name="module-name" value="libnativebridge-tests" />
- </test>
-
- <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
- one of the Mainline modules below is present on the device used for testing. -->
- <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
- <!-- ART Mainline Module (internal version). -->
- <option name="mainline-module-package-name" value="com.google.android.art" />
- <!-- ART Mainline Module (external (AOSP) version). -->
- <option name="mainline-module-package-name" value="com.android.art" />
- </object>
-
- <!-- Only run tests if the device under test is SDK version 31 (Android 12) or above. -->
- <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
-</configuration>
diff --git a/libprofile/Android.bp b/libprofile/Android.bp
index edea2ad5d8..ced2166957 100644
--- a/libprofile/Android.bp
+++ b/libprofile/Android.bp
@@ -208,5 +208,4 @@ art_cc_test {
"art_standalone_gtest_defaults",
"art_libprofile_tests_defaults",
],
- test_config: "art_standalone_libprofile_tests.xml",
}
diff --git a/libprofile/art_standalone_libprofile_tests.xml b/libprofile/art_standalone_libprofile_tests.xml
deleted file mode 100644
index 8a4cf8d627..0000000000
--- a/libprofile/art_standalone_libprofile_tests.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2021 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<configuration description="Runs art_standalone_libprofile_tests.">
- <option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
- <option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
-
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
- <option name="cleanup" value="true" />
- <option name="push" value="art_standalone_libprofile_tests->/data/local/tmp/art_standalone_libprofile_tests/art_standalone_libprofile_tests" />
- <option name="append-bitness" value="true" />
- </target_preparer>
-
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
- <option name="cleanup" value="true" />
- <option name="push" value="art-gtest-jars-ManyMethods.jar->/data/local/tmp/art_standalone_libprofile_tests/art-gtest-jars-ManyMethods.jar" />
- <option name="push" value="art-gtest-jars-MultiDex.jar->/data/local/tmp/art_standalone_libprofile_tests/art-gtest-jars-MultiDex.jar" />
- <option name="push" value="art-gtest-jars-ProfileTestMultiDex.jar->/data/local/tmp/art_standalone_libprofile_tests/art-gtest-jars-ProfileTestMultiDex.jar" />
- </target_preparer>
-
- <test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/art_standalone_libprofile_tests" />
- <option name="module-name" value="art_standalone_libprofile_tests" />
- </test>
-
- <!-- When this test is run in a Mainline context (e.g. with `mts-tradefed`), only enable it if
- one of the Mainline modules below is present on the device used for testing. -->
- <object type="module_controller" class="com.android.tradefed.testtype.suite.module.MainlineTestModuleController">
- <!-- ART Mainline Module (internal version). -->
- <option name="mainline-module-package-name" value="com.google.android.art" />
- <!-- ART Mainline Module (external (AOSP) version). -->
- <option name="mainline-module-package-name" value="com.android.art" />
- </object>
-
- <!-- Only run tests if the device under test is SDK version 31 (Android 12) or above. -->
- <object type="module_controller" class="com.android.tradefed.testtype.suite.module.Sdk31ModuleController" />
-</configuration>
diff --git a/test/art-gtests-target-standalone-cts-template.xml b/test/art-gtests-target-standalone-cts-template.xml
index 42ad284978..a8a04ac5a6 100644
--- a/test/art-gtests-target-standalone-cts-template.xml
+++ b/test/art-gtests-target-standalone-cts-template.xml
@@ -23,14 +23,13 @@
<option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
<option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
- <option name="append-bitness" value="true" />
+ <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
+ <option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="{MODULE}" />
</test>
diff --git a/test/art-gtests-target-standalone-non-multilib-template.xml b/test/art-gtests-target-standalone-non-multilib-template.xml
index e662c5f6f2..9aa3f3685c 100644
--- a/test/art-gtests-target-standalone-non-multilib-template.xml
+++ b/test/art-gtests-target-standalone-non-multilib-template.xml
@@ -19,14 +19,13 @@
<option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
<option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
- <option name="append-bitness" value="true" />
+ <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
+ <option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="{MODULE}" />
</test>
diff --git a/test/art-gtests-target-standalone-template.xml b/test/art-gtests-target-standalone-template.xml
index 1c21620342..3c3f11c5cf 100644
--- a/test/art-gtests-target-standalone-template.xml
+++ b/test/art-gtests-target-standalone-template.xml
@@ -18,14 +18,13 @@
<option name="config-descriptor:metadata" key="mainline-param" value="com.google.android.art.apex" />
<option name="config-descriptor:metadata" key="mainline-param" value="com.android.art.apex" />
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
- <option name="append-bitness" value="true" />
+ <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
+ <option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="{MODULE}" />
</test>
diff --git a/test/dexpreopt/art_standalone_dexpreopt_tests.xml b/test/dexpreopt/art_standalone_dexpreopt_tests.xml
index cf459e65af..283d4161ba 100644
--- a/test/dexpreopt/art_standalone_dexpreopt_tests.xml
+++ b/test/dexpreopt/art_standalone_dexpreopt_tests.xml
@@ -26,14 +26,13 @@
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
- <target_preparer class="com.android.compatibility.common.tradefed.targetprep.FilePusher">
+ <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}/{MODULE}" />
- <option name="append-bitness" value="true" />
+ <option name="push" value="{MODULE}->/data/local/tmp/{MODULE}" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
- <option name="native-test-device-path" value="/data/local/tmp/{MODULE}" />
+ <option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="{MODULE}" />
</test>