diff options
author | Steven Moreland <smoreland@google.com> | 2020-09-10 22:25:24 +0000 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2020-10-01 17:08:41 +0000 |
commit | 9e3c7074e60af8733e665ac8b84be57af5f7b0f0 (patch) | |
tree | 8bb56bfcab3a4950fe3eb0c1ed8319f2417daeeb /test | |
parent | 56ce49f8234a159b500b8d0f3fde4e5a42027f18 (diff) | |
download | hidl-9e3c7074e60af8733e665ac8b84be57af5f7b0f0.tar.gz |
All HIDL tests device -> general-tests.
None of these need to be built per-device, only the architecture
matters.
This didn't work w/ general-tests before because tradefed was running
32-bit tests from test_suites_x86_64 on 32-bit devices, which caused
this test to fail, since it still installed 64-bit tests in that case,
and this test tried to run it. Although a separate bug is filed to
investigate that, switching the method of abi detection here.
Bug: 168807095
Test: runs tests on 32 and 64-bit devices
Change-Id: If7e5a952d9a94871b96bf8536870297e6272a956
Diffstat (limited to 'test')
-rw-r--r-- | test/hidl_test/Android.bp | 2 | ||||
-rw-r--r-- | test/hidl_test/hidl_test.py | 8 | ||||
-rw-r--r-- | test/host_test/Android.bp | 2 | ||||
-rw-r--r-- | test/host_utils_test/Android.bp | 2 | ||||
-rw-r--r-- | test/java_test/Android.bp | 4 | ||||
-rw-r--r-- | test/java_test/hidl_test_java.py | 8 |
6 files changed, 13 insertions, 13 deletions
diff --git a/test/hidl_test/Android.bp b/test/hidl_test/Android.bp index 6fd08b02..069c8783 100644 --- a/test/hidl_test/Android.bp +++ b/test/hidl_test/Android.bp @@ -74,7 +74,7 @@ cc_defaults { suffix: "64", }, }, - test_suites: ["device-tests"], + test_suites: ["general-tests"], } cc_test { diff --git a/test/hidl_test/hidl_test.py b/test/hidl_test/hidl_test.py index 4964380d..1a58e5d6 100644 --- a/test/hidl_test/hidl_test.py +++ b/test/hidl_test/hidl_test.py @@ -41,18 +41,18 @@ def make_test(client, server): run_cmd("adb shell killall %s >/dev/null 2>&1" % server, ignore_error=True) return test -def has_binary(binary): - return 0 == run_cmd("adb shell ls %s >/dev/null" % binary, ignore_error=True) +def has_bitness(bitness): + return 0 == run_cmd("echo '[[ \"$(getprop ro.product.cpu.abilist%s)\" != \"\" ]]' | adb shell sh" % bitness, ignore_error=True) if __name__ == '__main__': clients = [] servers = [] - if has_binary("/data/nativetest/hidl_test_client/hidl_test_client"): + if has_bitness(32): clients += ["/data/nativetest/hidl_test_client/hidl_test_client"] servers += ["/data/nativetest/hidl_test_servers/hidl_test_servers"] - if has_binary("/data/nativetest64/hidl_test_client/hidl_test_client"): + if has_bitness(64): clients += ["/data/nativetest64/hidl_test_client/hidl_test_client"] servers += ["/data/nativetest64/hidl_test_servers/hidl_test_servers"] diff --git a/test/host_test/Android.bp b/test/host_test/Android.bp index f7d1fe07..fd9ad49e 100644 --- a/test/host_test/Android.bp +++ b/test/host_test/Android.bp @@ -26,5 +26,5 @@ cc_test_host { "liblog", ], srcs: ["main.cpp"], - test_suites: ["device-tests"], + test_suites: ["general-tests"], } diff --git a/test/host_utils_test/Android.bp b/test/host_utils_test/Android.bp index adc20199..38fa8e25 100644 --- a/test/host_utils_test/Android.bp +++ b/test/host_utils_test/Android.bp @@ -21,5 +21,5 @@ cc_test_host { "liblog", ], srcs: ["main.cpp"], - test_suites: ["device-tests"], + test_suites: ["general-tests"], } diff --git a/test/java_test/Android.bp b/test/java_test/Android.bp index ca5ac1d6..68745c11 100644 --- a/test/java_test/Android.bp +++ b/test/java_test/Android.bp @@ -57,7 +57,7 @@ cc_test { suffix: "64", }, }, - test_suites: ["device-tests"], + test_suites: ["general-tests"], } java_test { @@ -72,5 +72,5 @@ java_test { "android.hardware.tests.memory-V2.0-java", "android.hardware.tests.safeunion-V1.0-java", ], - test_suites: ["device-tests"], + test_suites: ["general-tests"], } diff --git a/test/java_test/hidl_test_java.py b/test/java_test/hidl_test_java.py index 215de558..2a5d8b34 100644 --- a/test/java_test/hidl_test_java.py +++ b/test/java_test/hidl_test_java.py @@ -48,16 +48,16 @@ def make_test(client, server): cleanup(server) return test -def has_binary(binary): - return 0 == run_cmd("adb shell ls %s >/dev/null" % binary, ignore_error=True) +def has_bitness(bitness): + return 0 == run_cmd("echo '[[ \"$(getprop ro.product.cpu.abilist%s)\" != \"\" ]]' | adb shell sh" % bitness, ignore_error=True) if __name__ == '__main__': cmds = ["app_process /data/framework com.android.commands.hidl_test_java.HidlTestJava"] - if has_binary("/data/nativetest/hidl_test_java_native/hidl_test_java_native"): + if has_bitness(32): cmds += ["/data/nativetest/hidl_test_java_native/hidl_test_java_native"] - if has_binary("/data/nativetest64/hidl_test_java_native/hidl_test_java_native"): + if has_bitness(64): cmds += ["/data/nativetest64/hidl_test_java_native/hidl_test_java_native"] assert len(cmds) >= 2 |