From 45dca5c8cc538392edbde4ee1077fc86509b2e38 Mon Sep 17 00:00:00 2001 From: Ronald Braunstein Date: Tue, 22 Oct 2024 01:41:20 +0000 Subject: test_module_config for sh_test Implemented test_module_config for sh_tests. There are some shell tests that have 130 cc_binaries and they get duplicated in the vts .zip. test_module_config allows deduping for lowmem and hwasan use cases freeing a 1 G in the zip. Moved some of the knowledge about constructing the make rules back to the provider. I haven't tried this for cc_test or rust_test, but I think it will be similar to sh_test if we ever need it. There is currently only one usecase for using test_module_config with sh_test (and none for cc_ or rust_) Also added "extra_test_configs" to sh_test Sample bp file. test_module_config { name: "vts_ltp_tmc", base: "vts_ltp_test_x86_64", test_suites: [ "general-tests", "vts" ], options: [ {name: "is-low-mem", value: "false"}, {name: "is-hwasan", value: "true"}, ], } Test: go test ./ Test: m vts_ltp_test_x86_64_hwasan Test: atest vts_ltp_test_x86_64_hwasan Test: m vts # inspect the zip for symlinks Test: CtsAppTestCases_android_server_am Test: atest -c -v vts_ltp_test_x86_64:vts_ltp_test_x86_64_hwa Change-Id: I5a36d798fd21180d653d09e54f40449a0ebcbd29 --- sh/sh_binary_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'sh/sh_binary_test.go') diff --git a/sh/sh_binary_test.go b/sh/sh_binary_test.go index 5a5043946..28f997d8e 100644 --- a/sh/sh_binary_test.go +++ b/sh/sh_binary_test.go @@ -176,6 +176,22 @@ func TestShTestHost(t *testing.T) { android.AssertBoolEquals(t, "LOCAL_IS_UNIT_TEST", true, actualData) } +func TestShTestExtraTestConfig(t *testing.T) { + result, _ := testShBinary(t, ` + sh_test { + name: "foo", + src: "test.sh", + filename: "test.sh", + extra_test_configs: ["config1.xml", "config2.xml"], + } + `) + + mod := result.ModuleForTests("foo", "android_arm64_armv8-a").Module().(*ShTest) + entries := android.AndroidMkEntriesForTest(t, result, mod)[0] + actualData := entries.EntryMap["LOCAL_EXTRA_FULL_TEST_CONFIGS"] + android.AssertStringPathsRelativeToTopEquals(t, "extra_configs", result.Config(), []string{"config1.xml", "config2.xml"}, actualData) +} + func TestShTestHost_dataDeviceModules(t *testing.T) { ctx, config := testShBinary(t, ` sh_test_host { -- cgit v1.2.3-59-g8ed1b