From 13f9816e14980233cbd6ca5e7a0fa3c1e179e54d Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 24 Jul 2018 14:58:05 -0700 Subject: tests: Create res-testdata for testdata pickup. It doesn't change the functionality of the test, but allows easier conversion to Soong. Test: Run recovery_component_test on marlin. Change-Id: Ic7419dc86c6b220531ae44e49ab4657394a5d7fa --- tests/Android.mk | 2 +- tests/component/resources_test.cpp | 9 +++++---- tests/res-testdata/res-hdpi | 1 + tests/res-testdata/res-mdpi | 1 + tests/res-testdata/res-xhdpi | 1 + tests/res-testdata/res-xxhdpi | 1 + tests/res-testdata/res-xxxhdpi | 1 + 7 files changed, 11 insertions(+), 5 deletions(-) create mode 120000 tests/res-testdata/res-hdpi create mode 120000 tests/res-testdata/res-mdpi create mode 120000 tests/res-testdata/res-xhdpi create mode 120000 tests/res-testdata/res-xxhdpi create mode 120000 tests/res-testdata/res-xxxhdpi diff --git a/tests/Android.mk b/tests/Android.mk index 3d3e63e7e..ef64d76ab 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -208,7 +208,7 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_TEST_DATA := \ $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*", testdata) \ - $(call find-test-data-in-subdirs, bootable/recovery, "*_text.png", res-*) + $(call find-test-data-in-subdirs, $(LOCAL_PATH), "*_text.png", res-testdata) include $(BUILD_NATIVE_TEST) # Host tests diff --git a/tests/component/resources_test.cpp b/tests/component/resources_test.cpp index 618d5a4dd..b00c3d528 100644 --- a/tests/component/resources_test.cpp +++ b/tests/component/resources_test.cpp @@ -32,10 +32,11 @@ static const std::string kLocale = "zu"; -static const std::vector kResourceImagesDirs{ "res-mdpi/images/", "res-hdpi/images/", - "res-xhdpi/images/", - "res-xxhdpi/images/", - "res-xxxhdpi/images/" }; +static const std::vector kResourceImagesDirs{ + "res-testdata/res-mdpi/images/", "res-testdata/res-hdpi/images/", + "res-testdata/res-xhdpi/images/", "res-testdata/res-xxhdpi/images/", + "res-testdata/res-xxxhdpi/images/", +}; static int png_filter(const dirent* de) { if (de->d_type != DT_REG || !android::base::EndsWith(de->d_name, "_text.png")) { diff --git a/tests/res-testdata/res-hdpi b/tests/res-testdata/res-hdpi new file mode 120000 index 000000000..c339b1df4 --- /dev/null +++ b/tests/res-testdata/res-hdpi @@ -0,0 +1 @@ +../../res-hdpi \ No newline at end of file diff --git a/tests/res-testdata/res-mdpi b/tests/res-testdata/res-mdpi new file mode 120000 index 000000000..4be630d6f --- /dev/null +++ b/tests/res-testdata/res-mdpi @@ -0,0 +1 @@ +../../res-mdpi \ No newline at end of file diff --git a/tests/res-testdata/res-xhdpi b/tests/res-testdata/res-xhdpi new file mode 120000 index 000000000..429eead83 --- /dev/null +++ b/tests/res-testdata/res-xhdpi @@ -0,0 +1 @@ +../../res-xhdpi \ No newline at end of file diff --git a/tests/res-testdata/res-xxhdpi b/tests/res-testdata/res-xxhdpi new file mode 120000 index 000000000..304cc28b3 --- /dev/null +++ b/tests/res-testdata/res-xxhdpi @@ -0,0 +1 @@ +../../res-xxhdpi \ No newline at end of file diff --git a/tests/res-testdata/res-xxxhdpi b/tests/res-testdata/res-xxxhdpi new file mode 120000 index 000000000..2236ad8cc --- /dev/null +++ b/tests/res-testdata/res-xxxhdpi @@ -0,0 +1 @@ +../../res-xxxhdpi \ No newline at end of file -- cgit v1.2.3