diff options
author | 2023-12-21 15:09:29 +0000 | |
---|---|---|
committer | 2023-12-21 15:09:29 +0000 | |
commit | 80ad5692c923dae191669994d92fd2784890633a (patch) | |
tree | 2acd1cb1534a1905a56c57a6ba31baa513b28f09 | |
parent | a68c25f524066105346499a2347c15ac6391fe94 (diff) | |
parent | e08696f240033bd252b90e99a93eba6366d77fe3 (diff) |
Revert "Construct BCP arguments to the VM using CommonArtTest code." am: e08696f240
Original change: https://android-review.googlesource.com/c/platform/art/+/2883706
Change-Id: I417b5dee1f3fe7434e59317f7d4a1db50f038f57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | libartpalette/apex/palette_test.cc | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/libartpalette/apex/palette_test.cc b/libartpalette/apex/palette_test.cc index c2b7304d8d..9273e51cf1 100644 --- a/libartpalette/apex/palette_test.cc +++ b/libartpalette/apex/palette_test.cc @@ -28,7 +28,6 @@ #include "android/api-level.h" #endif -#include "base/common_art_test.h" #include "gtest/gtest.h" namespace { @@ -97,27 +96,23 @@ TEST_F(PaletteClientTest, Ashmem) { #endif } -class PaletteClientJniTest : public art::CommonArtTest {}; - -TEST_F(PaletteClientJniTest, JniInvocation) { +TEST_F(PaletteClientTest, JniInvocation) { +#ifndef ART_TARGET_ANDROID + // On host we need to set up a boot classpath and pass it in here. Let's not + // bother since this test is only for native API coverage on target. + GTEST_SKIP() << "Will only spin up a VM on Android"; +#else bool enabled; EXPECT_EQ(PALETTE_STATUS_OK, PaletteShouldReportJniInvocations(&enabled)); - std::string boot_class_path_string = - GetClassPathOption("-Xbootclasspath:", GetLibCoreDexFileNames()); - std::string boot_class_path_locations_string = - GetClassPathOption("-Xbootclasspath-locations:", GetLibCoreDexLocations()); - + JavaVMInitArgs vm_args; JavaVMOption options[] = { - {.optionString = boot_class_path_string.c_str(), .extraInfo = nullptr}, - {.optionString = boot_class_path_locations_string.c_str(), .extraInfo = nullptr}, - }; - JavaVMInitArgs vm_args = { - .version = JNI_VERSION_1_6, - .nOptions = std::size(options), - .options = options, - .ignoreUnrecognized = JNI_TRUE, + {.optionString = "-verbose:jni", .extraInfo = nullptr}, }; + vm_args.version = JNI_VERSION_1_6; + vm_args.nOptions = std::size(options); + vm_args.options = options; + vm_args.ignoreUnrecognized = JNI_TRUE; JavaVM* jvm = nullptr; JNIEnv* env = nullptr; @@ -128,6 +123,7 @@ TEST_F(PaletteClientJniTest, JniInvocation) { PaletteNotifyEndJniInvocation(env); EXPECT_EQ(JNI_OK, jvm->DestroyJavaVM()); +#endif } TEST_F(PaletteClientTest, SetTaskProfiles) { |