blob: 6c7b26e7b68ef335e39fa3dc2990ae05a808780a [file] [log] [blame]
Tsu Chiang Chuang011fade2012-07-09 18:34:47 -07001# 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
16LOCAL_PATH := $(call my-dir)
17
18TEST_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
23define declare-make-art-run-test
24dmart_target := $(TARGET_OUT_DATA)/art-run-tests/$(1)/touch
Tsu Chiang Chuang6674f8a2013-01-16 15:41:21 -080025$$(dmart_target): $(DX) $(HOST_OUT_EXECUTABLES)/jasmin
Tsu Chiang Chuang011fade2012-07-09 18:34:47 -070026 $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@)
Tsu Chiang Chuang6674f8a2013-01-16 15:41:21 -080027 $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) $(LOCAL_PATH)/run-test --build-only --output-path $$(abspath $$(dir $$@)) $(1)
Tsu Chiang Chuang011fade2012-07-09 18:34:47 -070028 $(hide) touch $$@
29
30TEST_ART_RUN_TEST_MAKE_TARGETS += $$(dmart_target)
31dmart_target :=
32endef
33
34# Expand all tests.
35$(foreach test, $(wildcard art/test/[0-9]*), $(eval $(call declare-make-art-run-test,$(notdir $(test)))))
36
37include $(CLEAR_VARS)
38LOCAL_MODULE_TAGS := tests
39LOCAL_MODULE := art-run-tests
40LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_MAKE_TARGETS)
41include $(BUILD_PHONY_PACKAGE)
42
43# clear temp vars
44TEST_ART_RUN_TEST_MAKE_TARGETS :=
45declare-make-art-run-test :=