Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | ######################################################################## |
| 18 | |
| 19 | ART_TEST_DEX_FILES := |
| 20 | |
| 21 | # $(1): directory |
| 22 | define build-art-test-dex |
| 23 | include $(CLEAR_VARS) |
| 24 | LOCAL_MODULE := art-test-dex-$(1) |
| 25 | LOCAL_MODULE_TAGS := optional |
| 26 | LOCAL_SRC_FILES := $(call all-java-files-under, test/$(1)) |
| 27 | LOCAL_JAVA_LIBRARIES := core |
| 28 | LOCAL_NO_STANDARD_LIBRARIES := true |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 29 | LOCAL_MODULE_PATH := $(ART_TEST_OUT) |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 30 | include $(BUILD_JAVA_LIBRARY) |
| 31 | ART_TEST_DEX_FILES += $(TARGET_OUT_JAVA_LIBRARIES)/$$(LOCAL_MODULE).jar |
| 32 | endef |
| 33 | $(foreach dir,$(TEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,$(dir)))) |
| 34 | |
| 35 | ######################################################################## |
| 36 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 37 | # $(1): input jar or apk filename |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 38 | # $(2): output oat filename |
| 39 | # $(3): boot image |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 40 | define build-art-oat |
Brian Carlstrom | 03a20ba | 2011-10-13 10:24:13 -0700 | [diff] [blame] | 41 | $(2): $(1) $(3) $(DEX2OAT_DEPENDENCY) |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 42 | @echo "target dex2oat: $$@ ($$<)" |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 43 | $(hide) $(DEX2OAT) -Xms16m -Xmx16m --boot-image=$(3) $(addprefix --dex-file=,$$<) --oat=$$@ --host-prefix=$(PRODUCT_OUT) |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 44 | endef |
| 45 | |
| 46 | ######################################################################## |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 47 | ART_TEST_OAT_FILES := |
| 48 | |
| 49 | # $(1): directory |
| 50 | define build-art-test-oat |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 51 | $(call build-art-oat,$(ART_TEST_OUT)/art-test-dex-$(1).jar,$(ART_TEST_OUT)/art-test-dex-$(1).oat,$(TARGET_CORE_IMG)) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 52 | ART_TEST_OAT_FILES += $(ART_TEST_OUT)/art-test-dex-$(1).oat |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 53 | endef |
| 54 | $(foreach dir,$(TEST_DEX_DIRECTORIES), $(eval $(call build-art-test-oat,$(dir)))) |
| 55 | |
| 56 | ######################################################################## |
| 57 | |
| 58 | ART_TEST_OAT_TARGETS := |
| 59 | |
| 60 | # $(1): directory |
| 61 | # $(2): arguments |
| 62 | define declare-test-test-target |
| 63 | .PHONY: test-art-target-oat-$(1) |
| 64 | test-art-target-oat-$(1): test-art-target-sync |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 65 | adb shell touch $(ART_TEST_DIR)/test-art-target-oat-$(1) |
| 66 | adb shell rm $(ART_TEST_DIR)/test-art-target-oat-$(1) |
| 67 | adb shell sh -c "oatexecd -Ximage:$(ART_TEST_DIR)/core.art -classpath $(ART_TEST_DIR)/art-test-dex-$(1).jar $(1) $(2) && touch $(ART_TEST_DIR)/test-art-target-oat-$(1)" |
| 68 | $(hide) (adb pull $(ART_TEST_DIR)/test-art-target-oat-$(1) /tmp/ && echo test-art-target-oat-$(1) PASSED) || (echo test-art-target-oat-$(1) FAILED && exit 1) |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 69 | $(hide) rm /tmp/test-art-target-oat-$(1) |
| 70 | |
| 71 | ART_TEST_OAT_TARGETS += test-art-target-oat-$(1) |
| 72 | endef |
| 73 | |
| 74 | $(eval $(call declare-test-test-target,HelloWorld,)) |
| 75 | $(eval $(call declare-test-test-target,Fibonacci,10)) |
buzbee | c0fe6c7 | 2011-09-18 20:19:14 -0700 | [diff] [blame] | 76 | $(eval $(call declare-test-test-target,IntMath,)) |
Brian Carlstrom | 25c3325 | 2011-09-18 15:58:35 -0700 | [diff] [blame] | 77 | $(eval $(call declare-test-test-target,Invoke,)) |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 78 | $(eval $(call declare-test-test-target,ExceptionTest,)) |
Elliott Hughes | 29f2742 | 2011-09-18 16:02:18 -0700 | [diff] [blame] | 79 | $(eval $(call declare-test-test-target,SystemMethods,)) |
Brian Carlstrom | 92827a5 | 2011-10-10 15:50:01 -0700 | [diff] [blame] | 80 | $(eval $(call declare-test-test-target,MemUsage,)) |
Shih-wei Liao | 63433ba | 2011-10-15 18:40:39 -0700 | [diff] [blame] | 81 | $(eval $(call declare-test-test-target,ReferenceMap,)) |
Shih-wei Liao | 8e4b2fc | 2011-10-11 10:43:52 -0700 | [diff] [blame] | 82 | $(eval $(call declare-test-test-target,StackWalk,)) |
Brian Carlstrom | 92827a5 | 2011-10-10 15:50:01 -0700 | [diff] [blame] | 83 | |
Shih-wei Liao | 8e4b2fc | 2011-10-11 10:43:52 -0700 | [diff] [blame] | 84 | # TODO: Enable when the StackWalk2 tests are passing |
Shih-wei Liao | 9407c60 | 2011-09-16 10:36:43 -0700 | [diff] [blame] | 85 | # $(eval $(call declare-test-test-target,StackWalk2,)) |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 86 | |
Brian Carlstrom | bbf1e41 | 2011-09-18 14:14:51 -0700 | [diff] [blame] | 87 | ######################################################################## |