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