Tsu Chiang Chuang | 011fade | 2012-07-09 18:34:47 -0700 | [diff] [blame] | 1 | # Copyright (C) 2012 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
| 15 | |
| 16 | LOCAL_PATH := $(call my-dir) |
| 17 | |
| 18 | TEST_ART_RUN_TEST_MAKE_TARGETS := |
| 19 | |
| 20 | # Helper to create individual build targets for tests. |
| 21 | # Must be called with $(eval) |
| 22 | # $(1): the test number |
| 23 | define declare-make-art-run-test |
| 24 | dmart_target := $(TARGET_OUT_DATA)/art-run-tests/$(1)/touch |
Tsu Chiang Chuang | 6674f8a | 2013-01-16 15:41:21 -0800 | [diff] [blame] | 25 | $$(dmart_target): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin |
Tsu Chiang Chuang | 011fade | 2012-07-09 18:34:47 -0700 | [diff] [blame] | 26 | $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@) |
Tsu Chiang Chuang | 6674f8a | 2013-01-16 15:41:21 -0800 | [diff] [blame] | 27 | $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) $(LOCAL_PATH)/run-test --build-only --output-path $$(abspath $$(dir $$@)) $(1) |
Tsu Chiang Chuang | 011fade | 2012-07-09 18:34:47 -0700 | [diff] [blame] | 28 | $(hide) touch $$@ |
| 29 | |
| 30 | TEST_ART_RUN_TEST_MAKE_TARGETS += $$(dmart_target) |
| 31 | dmart_target := |
| 32 | endef |
| 33 | |
| 34 | # Expand all tests. |
| 35 | $(foreach test, $(wildcard art/test/[0-9]*), $(eval $(call declare-make-art-run-test,$(notdir $(test))))) |
| 36 | |
| 37 | include $(CLEAR_VARS) |
| 38 | LOCAL_MODULE_TAGS := tests |
| 39 | LOCAL_MODULE := art-run-tests |
| 40 | LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_MAKE_TARGETS) |
| 41 | include $(BUILD_PHONY_PACKAGE) |
| 42 | |
| 43 | # clear temp vars |
| 44 | TEST_ART_RUN_TEST_MAKE_TARGETS := |
| 45 | declare-make-art-run-test := |