1# 2# Copyright (C) 2017 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 17LOCAL_PATH := $(call my-dir) 18 19include $(CLEAR_VARS) 20 21# shim classes. We use one that exposes the common functionality. 22LOCAL_SHIM_CLASSES := \ 23 902-hello-transformation/src/art/Redefinition.java \ 24 903-hello-tagging/src/art/Main.java \ 25 26LOCAL_SRC_FILES := $(LOCAL_SHIM_CLASSES) 27 28# Actual test classes. 29LOCAL_SRC_FILES += \ 30 901-hello-ti-agent/src/art/Test901.java \ 31 902-hello-transformation/src/art/Test902.java \ 32 903-hello-tagging/src/art/Test903.java \ 33 904-object-allocation/src/art/Test904.java \ 34 905-object-free/src/art/Test905.java \ 35 906-iterate-heap/src/art/Test906.java \ 36 907-get-loaded-classes/src/art/Test907.java \ 37 908-gc-start-finish/src/art/Test908.java \ 38 910-methods/src/art/Test910.java \ 39 911-get-stack-trace/src/art/Test911.java \ 40 911-get-stack-trace/src/art/AllTraces.java \ 41 911-get-stack-trace/src/art/ControlData.java \ 42 911-get-stack-trace/src/art/Frames.java \ 43 911-get-stack-trace/src/art/OtherThread.java \ 44 911-get-stack-trace/src/art/PrintThread.java \ 45 911-get-stack-trace/src/art/Recurse.java \ 46 911-get-stack-trace/src/art/SameThread.java \ 47 911-get-stack-trace/src/art/ThreadListTraces.java \ 48 912-classes/src/art/Test912.java \ 49 912-classes/src/art/DexData.java \ 50 913-heaps/src/art/Test913.java \ 51 914-hello-obsolescence/src/art/Test914.java \ 52 915-obsolete-2/src/art/Test915.java \ 53 917-fields-transformation/src/art/Test917.java \ 54 918-fields/src/art/Test918.java \ 55 919-obsolete-fields/src/art/Test919.java \ 56 920-objects/src/art/Test920.java \ 57 922-properties/src/art/Test922.java \ 58 923-monitors/src/art/Test923.java \ 59 924-threads/src/art/Test924.java \ 60 925-threadgroups/src/art/Test925.java \ 61 926-multi-obsolescence/src/art/Test926.java \ 62 927-timers/src/art/Test927.java \ 63 928-jni-table/src/art/Test928.java \ 64 930-hello-retransform/src/art/Test930.java \ 65 931-agent-thread/src/art/Test931.java \ 66 932-transform-saves/src/art/Test932.java \ 67 933-misc-events/src/art/Test933.java \ 68 940-recursive-obsolete/src/art/Test940.java \ 69 942-private-recursive/src/art/Test942.java \ 70 944-transform-classloaders/src/art/Test944.java \ 71 945-obsolete-native/src/art/Test945.java \ 72 947-reflect-method/src/art/Test947.java \ 73 951-threaded-obsolete/src/art/Test951.java \ 74 981-dedup-original-dex/src/art/Test981.java \ 75 982-ok-no-retransform/src/art/Test982.java \ 76 984-obsolete-invoke/src/art/Test984.java \ 77 985-re-obsolete/src/art/Test985.java \ 78 986-native-method-bind/src/art/Test986.java \ 79 80JVMTI_RUN_TEST_GENERATED_NUMBERS := \ 81 901 \ 82 902 \ 83 903 \ 84 904 \ 85 905 \ 86 906 \ 87 907 \ 88 908 \ 89 910 \ 90 911 \ 91 912 \ 92 913 \ 93 914 \ 94 915 \ 95 917 \ 96 918 \ 97 919 \ 98 920 \ 99 922 \ 100 923 \ 101 924 \ 102 925 \ 103 926 \ 104 927 \ 105 928 \ 106 930 \ 107 931 \ 108 932 \ 109 933 \ 110 940 \ 111 942 \ 112 944 \ 113 945 \ 114 947 \ 115 951 \ 116 981 \ 117 982 \ 118 984 \ 119 985 \ 120 986 \ 121 122# Try to enforce that the directories correspond to the Java files we pull in. 123JVMTI_RUN_TEST_DIR_CHECK := $(sort $(foreach DIR,$(JVMTI_RUN_TEST_GENERATED_NUMBERS), \ 124 $(filter $(DIR)%,$(LOCAL_SRC_FILES)))) 125ifneq ($(sort $(LOCAL_SRC_FILES)),$(JVMTI_RUN_TEST_DIR_CHECK)) 126 $(error Missing file, compare $(sort $(LOCAL_SRC_FILES)) with $(JVMTI_RUN_TEST_DIR_CHECK)) 127endif 128 129LOCAL_MODULE_CLASS := JAVA_LIBRARIES 130LOCAL_MODULE_TAGS := optional 131LOCAL_JAVA_LANGUAGE_VERSION := 1.8 132LOCAL_MODULE := run-test-jvmti-java 133 134GENERATED_SRC_DIR := $(call local-generated-sources-dir) 135JVMTI_RUN_TEST_GENERATED_FILES := \ 136 $(foreach NR,$(JVMTI_RUN_TEST_GENERATED_NUMBERS),$(GENERATED_SRC_DIR)/results.$(NR).expected.txt) 137 138define GEN_JVMTI_RUN_TEST_GENERATED_FILE 139 140GEN_INPUT := $(wildcard $(LOCAL_PATH)/$(1)*/expected.txt) 141GEN_OUTPUT := $(GENERATED_SRC_DIR)/results.$(1).expected.txt 142$$(GEN_OUTPUT): $$(GEN_INPUT) 143 cp $$< $$@ 144 145GEN_INPUT := 146GEN_OUTPUT := 147 148endef 149 150$(foreach NR,$(JVMTI_RUN_TEST_GENERATED_NUMBERS),\ 151 $(eval $(call GEN_JVMTI_RUN_TEST_GENERATED_FILE,$(NR)))) 152LOCAL_JAVA_RESOURCE_FILES := $(JVMTI_RUN_TEST_GENERATED_FILES) 153 154include $(BUILD_JAVA_LIBRARY) 155