From 6e95dd56e43b3a29fb8360bd94e31cd2eaab1d3d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 12 Sep 2016 15:37:10 -0700 Subject: Convert art gtests to Android.bp This splits the compilation and running of the art gtests into two separate locations. The tests are now compiled in multiple Android.bp modules in each directory. art.go collects the installed locations of each test and exports it as make variables. art/build/Android.gtest.mk converts the list into the rules to run the tests. This has a few changes in behavior: - The rules to build tests are now always defined, and will build as part of mmma art or make checkbuild. - Host tests are no longer installed into out/host/linux-x86/bin, they are in out/host/linux-x86/nativetest[64]// - Target tests are now in /data/nativetest[64]/art/// Test: mmma -j art Test: m -j test-art-host Test: m -j test-art-target Change-Id: Iabcd99d43890e6b693688422b07a283c3226a496 --- test/Android.bp | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) (limited to 'test') diff --git a/test/Android.bp b/test/Android.bp index e2edc1895e..46d7c94878 100644 --- a/test/Android.bp +++ b/test/Android.bp @@ -14,6 +14,103 @@ // limitations under the License. // +art_cc_defaults { + name: "art_test_defaults", + host_supported: true, + test_per_src: true, + // These really are gtests, but the gtest library comes from libart-gtest.so + gtest: false, + defaults: [ + "art_defaults", + "art_debug_defaults", + ], + + shared_libs: [ + "libartd", + "libartd-disassembler", + "libvixld-arm", + "libvixld-arm64", + "libart-gtest", + + "libicuuc", + "libicui18n", + "libnativehelper", + ], + whole_static_libs: [ + "libsigchain", + ], + include_dirs: [ + "art", + "art/cmdline", + ], + + target: { + linux: { + ldflags: [ + // Allow jni_compiler_test to find Java_MyClassNatives_bar + // within itself using dlopen(NULL, ...). + // Mac OS linker doesn't understand --export-dynamic. + "-Wl,--export-dynamic", + "-Wl,-u,Java_MyClassNatives_bar", + "-Wl,-u,Java_MyClassNatives_sbar", + ], + shared_libs: [ + "libziparchive", + "libz-host", + ], + host_ldlibs: [ + "-ldl", + "-lpthread", + ], + cflags: [ + // gtest issue + "-Wno-used-but-marked-unused", + "-Wno-deprecated", + "-Wno-missing-noreturn", + ], + }, + android: { + ldflags: [ + // Allow jni_compiler_test to find Java_MyClassNatives_bar + // within itself using dlopen(NULL, ...). + "-Wl,--export-dynamic", + "-Wl,-u,Java_MyClassNatives_bar", + "-Wl,-u,Java_MyClassNatives_sbar", + ], + shared_libs: [ + "libcutils", + "libdl", + "libz", + ], + cflags: [ + // gtest issue + "-Wno-used-but-marked-unused", + "-Wno-deprecated", + "-Wno-missing-noreturn", + ], + }, + + android_arm: { + relative_install_path: "art/arm", + }, + android_arm64: { + relative_install_path: "art/arm64", + }, + android_mips: { + relative_install_path: "art/mips", + }, + android_mips64: { + relative_install_path: "art/mips64", + }, + android_x86: { + relative_install_path: "art/x86", + }, + android_x86_64: { + relative_install_path: "art/x86_64", + }, + }, +} + art_cc_defaults { name: "libart-gtest-defaults", host_supported: true, -- cgit v1.2.3-59-g8ed1b