diff options
author | 2023-10-02 19:58:53 +0000 | |
---|---|---|
committer | 2023-10-02 21:09:51 +0000 | |
commit | 81d73d78fc65362c005cc82b75d601e2fd10b688 (patch) | |
tree | bbfe8abc1996e48e871f95ce3930e36a06cb6243 /libnativebridge | |
parent | 75b8352c216dbce3f179ed9053d0e8355d1ad306 (diff) |
Isolate ValidNameNativeBridge_test.
The test depends on static state that cannot be reset and is
modified by other tests. Upstream googletest sorts the tests
before running them, so it's no longer possible to control the
order of tests via the order of the srcs attribute.
Bug: 302771018
Test: art/libnativebridge/tests/runtests.sh
Change-Id: If6b96049f6ed7a276ca1dcd0d7a70966d7ffecbf
Diffstat (limited to 'libnativebridge')
-rw-r--r-- | libnativebridge/tests/Android.bp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/libnativebridge/tests/Android.bp b/libnativebridge/tests/Android.bp index b416b0081e..f98fadc42d 100644 --- a/libnativebridge/tests/Android.bp +++ b/libnativebridge/tests/Android.bp @@ -186,9 +186,6 @@ cc_test { // loaded, to avoid the problems with test_per_src and pushing the extra // libnativebridge*-test-case.so files to device through tradefed. srcs: [ - // ValidNameNativeBridge_test.cpp needs to be first due to global state - // had_error that isn't reset between tests. - "ValidNameNativeBridge_test.cpp", "NeedsNativeBridge_test.cpp", "UnavailableNativeBridge_test.cpp", ], @@ -209,6 +206,35 @@ cc_test { ], } +// ValidNameNativeBridge_test.cpp needs to be in it own executable due +// to global state had_error that isn't reset between tests. +cc_test { + name: "art_libnativebridge_valid_name_cts_tests", + defaults: [ + "art_standalone_test_defaults", + "libnativebridge-tests-defaults", + ], + + srcs: [ + "ValidNameNativeBridge_test.cpp", + ], + static_libs: [ + "libdl_android", + "libnativebridge", + ], + shared_libs: [ + "liblog", + ], + header_libs: ["libbase_headers"], + + test_config_template: ":art-gtests-target-standalone-cts-template", + test_suites: [ + "cts", + "general-tests", + "mts-art", + ], +} + cc_test { name: "libnativebridge-lazy-tests", defaults: ["libnativebridge-tests-defaults"], |