From eec9529de8d76e3a48d8549fc115364a28da75c0 Mon Sep 17 00:00:00 2001 From: Nelson Li Date: Wed, 18 Apr 2018 17:51:58 +0000 Subject: [PATCH] build/make: auto generate Test config file for Google Benchmark Test BUG: 74844131 Test: cd bionic/; mm (auto generating the test config in out/) atest bionic-benchmarks (full testing in atest) Change-Id: I0497eed876640893d0b82d4cde384d3608cf4875 --- core/autogen_test_config.mk | 7 ++++- core/base_rules.mk | 4 --- core/clear_vars.mk | 1 + core/config.mk | 1 + .../native_benchmark_test_config_template.xml | 28 +++++++++++++++++++ 5 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 core/native_benchmark_test_config_template.xml diff --git a/core/autogen_test_config.mk b/core/autogen_test_config.mk index c359bacdfe..d2eb7c3880 100644 --- a/core/autogen_test_config.mk +++ b/core/autogen_test_config.mk @@ -24,8 +24,13 @@ autogen_test_config_file := $(dir $(LOCAL_BUILT_MODULE))$(LOCAL_MODULE).config ifeq (true,$(is_native)) +ifeq ($(LOCAL_NATIVE_BENCHMARK),true) +autogen_test_config_template := $(NATIVE_BENCHMARK_TEST_CONFIG_TEMPLATE) +else +autogen_test_config_template := $(NATIVE_TEST_CONFIG_TEMPLATE) +endif # Auto generating test config file for native test -$(autogen_test_config_file) : $(NATIVE_TEST_CONFIG_TEMPLATE) +$(autogen_test_config_file) : $(autogen_test_config_template) @echo "Auto generating test config $(notdir $@)" $(hide) sed 's&{MODULE}&$(PRIVATE_MODULE)&g' $^ > $@ my_auto_generate_config := true diff --git a/core/base_rules.mk b/core/base_rules.mk index 94c323ec22..1e513de1be 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -546,10 +546,6 @@ ifeq ($(LOCAL_MODULE_CLASS),NATIVE_TESTS) is_native := true multi_arch := true endif -ifeq ($(LOCAL_MODULE_CLASS),NATIVE_BENCHMARK) - is_native := true - multi_arch := true -endif ifdef LOCAL_MULTILIB multi_arch := true endif diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 62549d97e6..d0fe048b9a 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -163,6 +163,7 @@ LOCAL_MODULE_UNSUPPORTED_HOST_CROSS_ARCH_WARN:= LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH:= LOCAL_MODULE_UNSUPPORTED_TARGET_ARCH_WARN:= LOCAL_MULTILIB:= +LOCAL_NATIVE_BENCHMARK:= LOCAL_NDK_STL_VARIANT:= LOCAL_NDK_VERSION:=current LOCAL_NO_CRT:= diff --git a/core/config.mk b/core/config.mk index 7a4255267d..94642cddc6 100644 --- a/core/config.mk +++ b/core/config.mk @@ -152,6 +152,7 @@ BUILD_HOST_TEST_CONFIG := $(BUILD_SYSTEM)/host_test_config.mk BUILD_TARGET_TEST_CONFIG := $(BUILD_SYSTEM)/target_test_config.mk INSTRUMENTATION_TEST_CONFIG_TEMPLATE := $(BUILD_SYSTEM)/instrumentation_test_config_template.xml +NATIVE_BENCHMARK_TEST_CONFIG_TEMPLATE := $(BUILD_SYSTEM)/native_benchmark_test_config_template.xml NATIVE_TEST_CONFIG_TEMPLATE := $(BUILD_SYSTEM)/native_test_config_template.xml EMPTY_TEST_CONFIG := $(BUILD_SYSTEM)/empty_test_config.xml diff --git a/core/native_benchmark_test_config_template.xml b/core/native_benchmark_test_config_template.xml new file mode 100644 index 0000000000..18736bfdfc --- /dev/null +++ b/core/native_benchmark_test_config_template.xml @@ -0,0 +1,28 @@ + + + + +