Copy test font files into data directory.
To work native tests with additional font related files, copy the files into /data/nativetest/minikin_tests/. This copy only happens when the minikin_tests is built. It is not an expected to copy the font files into the product image. Change-Id: I7d83abc077bce4e38fd93c7d607bc7e1f7871e6b
This commit is contained in:
@@ -16,12 +16,49 @@
|
||||
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
data_root_for_test_zip := $(TARGET_OUT_DATA)/DATA/
|
||||
minikin_tests_subpath_from_data := nativetest/minikin_tests
|
||||
minikin_tests_root_in_device := /data/$(minikin_tests_subpath_from_data)
|
||||
minikin_tests_root_for_test_zip := $(data_root_for_test_zip)/$(minikin_tests_subpath_from_data)
|
||||
|
||||
define build-one-test-font-module
|
||||
$(eval include $(CLEAR_VARS))\
|
||||
$(eval LOCAL_MODULE := $(1))\
|
||||
$(eval LOCAL_SRC_FILES := $(1))\
|
||||
$(eval LOCAL_MODULE_CLASS := ETC)\
|
||||
$(eval LOCAL_MODULE_TAGS := tests)\
|
||||
$(eval LOCAL_MODULE_PATH := $(minikin_tests_root_for_test_zip))\
|
||||
$(eval include $(BUILD_PREBUILT))
|
||||
endef
|
||||
|
||||
font_src_files := \
|
||||
data/BoldItalic.ttf \
|
||||
data/Bold.ttf \
|
||||
data/ColorEmojiFont.ttf \
|
||||
data/ColorTextMixedEmojiFont.ttf \
|
||||
data/Emoji.ttf \
|
||||
data/Italic.ttf \
|
||||
data/Ja.ttf \
|
||||
data/Ko.ttf \
|
||||
data/NoGlyphFont.ttf \
|
||||
data/Regular.ttf \
|
||||
data/TextEmojiFont.ttf \
|
||||
data/VarioationSelectorTest-Regular.ttf \
|
||||
data/ZhHans.ttf \
|
||||
data/ZhHant.ttf \
|
||||
data/itemize.xml \
|
||||
data/emoji.xml
|
||||
|
||||
$(foreach f, $(font_src_files), $(call build-one-test-font-module, $(f)))
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
LOCAL_MODULE := minikin_tests
|
||||
LOCAL_MODULE_TAGS := tests
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libminikin
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES = $(font_src_files)
|
||||
LOCAL_PICKUP_FILES := $(data_root_for_test_zip)
|
||||
|
||||
# Shared libraries which are dependencies of minikin; these are not automatically
|
||||
# pulled in by the build system (and thus sadly must be repeated).
|
||||
@@ -56,6 +93,7 @@ LOCAL_C_INCLUDES := \
|
||||
external/libxml2/include \
|
||||
external/skia/src/core
|
||||
|
||||
LOCAL_CPPFLAGS += -Werror -Wall -Wextra
|
||||
LOCAL_CPPFLAGS += -Werror -Wall -Wextra \
|
||||
-DkTestFontDir="\"$(minikin_tests_root_in_device)/data/\""
|
||||
|
||||
include $(BUILD_NATIVE_TEST)
|
||||
|
||||
@@ -25,8 +25,6 @@ using android::FontFamily;
|
||||
using android::FontLanguage;
|
||||
using android::FontStyle;
|
||||
|
||||
#define kTestFontDir "/data/minikin/test/data/"
|
||||
|
||||
const char kItemizeFontXml[] = kTestFontDir "itemize.xml";
|
||||
const char kEmojiFont[] = kTestFontDir "Emoji.ttf";
|
||||
const char kJAFont[] = kTestFontDir "Ja.ttf";
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace android {
|
||||
// U+717D U+FE02 (VS3)
|
||||
// U+717D U+E0102 (VS19)
|
||||
// U+717D U+E0103 (VS20)
|
||||
const char kVsTestFont[] = "/data/minikin/test/data/VarioationSelectorTest-Regular.ttf";
|
||||
const char kVsTestFont[] = kTestFontDir "/VarioationSelectorTest-Regular.ttf";
|
||||
|
||||
void expectVSGlyphs(const FontCollection& fc, uint32_t codepoint, const std::set<uint32_t>& vsSet) {
|
||||
for (uint32_t vs = 0xFE00; vs <= 0xE01EF; ++vs) {
|
||||
|
||||
@@ -120,7 +120,7 @@ TEST(FontLanguagesTest, registerLanguageListTest) {
|
||||
// U+717D U+FE02 (VS3)
|
||||
// U+717D U+E0102 (VS19)
|
||||
// U+717D U+E0103 (VS20)
|
||||
const char kVsTestFont[] = "/data/minikin/test/data/VarioationSelectorTest-Regular.ttf";
|
||||
const char kVsTestFont[] = kTestFontDir "VarioationSelectorTest-Regular.ttf";
|
||||
|
||||
class FontFamilyTest : public testing::Test {
|
||||
public:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
mmm -j8 frameworks/minikin/tests &&
|
||||
adb push $OUT/data/nativetest/minikin_tests/minikin_tests \
|
||||
/data/nativetest/minikin_tests/minikin_tests &&
|
||||
adb push -p frameworks/minikin/tests/data /data/minikin/test/data &&
|
||||
adb push frameworks/minikin/tests/data /data/nativetest/minikin_tests/data &&
|
||||
adb shell /data/nativetest/minikin_tests/minikin_tests
|
||||
|
||||
Reference in New Issue
Block a user