summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJed Estep <jestep@google.com>2017-02-03 18:37:06 -0800
committerJed Estep <jestep@google.com>2017-02-14 15:57:49 -0800
commit96134c170b969eeb140725cf33bbc22353cfd835 (patch)
tree0ed03b68b7ae05077e04d78f9fd914588bbafc9e /tests
parentfa5fbd7358636f4fb8a1242949d34c6393e8446f (diff)
downloadextras-96134c170b969eeb140725cf33bbc22353cfd835.tar.gz
Add a build target for bootloader tests
Since the .py files don't need to be built, they can be packaged as-is. We can use a PHONY_PACKAGE with the source files set as the target's LOCAL_PICKUP_FILES to make them accessible to packaging targets like google_tests. Test: make bootloader_unit_test Bug: 33559158 Change-Id: I4a4453481d25a7dacb5bd8e8680328350d95f553
Diffstat (limited to 'tests')
-rw-r--r--tests/bootloader/Android.mk26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/bootloader/Android.mk b/tests/bootloader/Android.mk
new file mode 100644
index 00000000..21905e98
--- /dev/null
+++ b/tests/bootloader/Android.mk
@@ -0,0 +1,26 @@
+LOCAL_PATH := $(call my-dir)
+
+# Build a module that has all of the python files as its LOCAL_PICKUP_FILES.
+# Since no action needs to be taken to compile the python source, just
+# use BUILD_PHONY_PACKAGE to give us a target to execute.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := bootloader_unit_test
+LOCAL_MODULE_TAGS := optional
+
+bootloader_py_files := $(call find-subdir-files, *.py)
+
+bootloader_zip_prefix := $(TARGET_OUT_DATA)/py_bootloader
+bootloader_zip_path := $(bootloader_zip_prefix)/nativetest/py_bootloader
+
+GEN := $(addprefix $(bootloader_zip_path)/, $(bootloader_py_files))
+$(GEN) : PRIVATE_PATH := $(LOCAL_PATH)
+$(GEN) : PRIVATE_CUSTOM_TOOL = cp $< $@
+$(GEN) : $(bootloader_zip_path)/% : $(LOCAL_PATH)/%
+ $(transform-generated-source)
+
+LOCAL_PICKUP_FILES := $(bootloader_zip_prefix)/nativetest
+
+bootloader_unit_test: $(GEN)
+
+include $(BUILD_PHONY_PACKAGE)