提交 efaf02ea 编写于 作者: S Seigo Nonaka

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
上级 6d9dcd2c
......@@ -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:
......
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册