summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Wei Li <weiwli@google.com> 2025-02-03 09:26:00 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-02-03 09:26:00 -0800
commitcfef0ea67fee45eb148a035de1baf8bd5c618d28 (patch)
tree5e26c187dfbf772380cc606bc17492bab9e71c5b
parent8d895a8c299ebbfa526532aa740745edfe2b5d84 (diff)
parent31c61c922fad3ef36e9b69f5d21905ed746f77bb (diff)
Convert art/tools/ahat/Android.mk to Android.bp am: 31c61c922f
Original change: https://android-review.googlesource.com/c/platform/art/+/3470659 Change-Id: I9770ce89827de8bb6d42fb44d5e64a56c36d4d90 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.mk2
-rw-r--r--tools/ahat/Android.bp38
-rw-r--r--tools/ahat/Android.mk62
-rw-r--r--tools/ahat/ahat-tests.xml23
-rw-r--r--tools/ahat/etc/Android.bp30
5 files changed, 63 insertions, 92 deletions
diff --git a/Android.mk b/Android.mk
index f83c13cdf9..1405aa79ff 100644
--- a/Android.mk
+++ b/Android.mk
@@ -28,8 +28,6 @@ include $(art_path)/build/Android.cpplint.mk
########################################################################
# product rules
-include $(art_path)/tools/ahat/Android.mk
-
ART_HOST_DEPENDENCIES := \
$(ART_HOST_EXECUTABLES) \
$(ART_HOST_DEX_DEPENDENCIES) \
diff --git a/tools/ahat/Android.bp b/tools/ahat/Android.bp
index 57d239cc54..29fc18f5e4 100644
--- a/tools/ahat/Android.bp
+++ b/tools/ahat/Android.bp
@@ -13,11 +13,6 @@
// limitations under the License.
package {
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "art_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["art_license"],
}
@@ -56,6 +51,12 @@ java_test_helper_library {
srcs: ["src/ri-test-dump/**/*.java"],
}
+java_binary_host {
+ name: "ahat-ri-test-dump-bin",
+ static_libs: ["ahat-ri-test-dump"],
+ main_class: "Main",
+}
+
cc_library_shared {
name: "libahat-test-jni",
srcs: ["src/test/jni/**/*.cpp"],
@@ -72,3 +73,30 @@ java_genrule {
out: ["ahat-test-dump-gen.sh"],
cmd: "sed -e s=@AHAT_TEST_DUMP_JAR@=$(location :ahat-test-dump)= $(location ahat-test-dump-gen.sh.in) > $(out)",
}
+
+// Run ahat-ri-test-dump to generate ri-test-dump.hprof
+genrule {
+ name: "ahat_ri_test_dump_hprof",
+ out: ["ri-test-dump.hprof"],
+ tools: ["ahat-ri-test-dump-bin"],
+ cmd: "$(location ahat-ri-test-dump-bin) $(out)",
+}
+
+// To run these tests, use: atest ahat-tests --host
+java_test_host {
+ name: "ahat-tests",
+ srcs: ["src/test/**/*.java"],
+ manifest: "etc/ahat-tests.mf",
+ java_resources: [
+ ":ahat_ri_test_dump_hprof",
+ ":ahat-tests-res",
+ ],
+ static_libs: [
+ "ahat",
+ "junit-host",
+ ],
+ test_options: {
+ unit_test: true,
+ },
+ test_suites: ["general-tests"],
+}
diff --git a/tools/ahat/Android.mk b/tools/ahat/Android.mk
deleted file mode 100644
index 8a1ab87303..0000000000
--- a/tools/ahat/Android.mk
+++ /dev/null
@@ -1,62 +0,0 @@
-#
-# Copyright (C) 2015 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include art/build/Android.common_path.mk
-
-# Determine the location of the ri-test-dump.jar and ri-test-dump.hprof.
-AHAT_RI_TEST_DUMP_JAR := $(call intermediates-dir-for,JAVA_LIBRARIES,ahat-ri-test-dump,HOST)/javalib.jar
-AHAT_RI_TEST_DUMP_COMMON := $(call intermediates-dir-for,JAVA_LIBRARIES,ahat-ri-test-dump,HOST,COMMON)
-AHAT_RI_TEST_DUMP_HPROF := $(AHAT_RI_TEST_DUMP_COMMON)/ri-test-dump.hprof
-
-# Run ahat-ri-test-dump.jar to generate ri-test-dump.hprof
-$(AHAT_RI_TEST_DUMP_HPROF): PRIVATE_AHAT_RI_TEST_DUMP_JAR := $(AHAT_RI_TEST_DUMP_JAR)
-$(AHAT_RI_TEST_DUMP_HPROF): $(AHAT_RI_TEST_DUMP_JAR)
- rm -rf $@
- java -cp $(PRIVATE_AHAT_RI_TEST_DUMP_JAR) Main $@
-
-# --- ahat-tests.jar --------------
-# To run these tests, use: atest ahat-tests --host
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-java-files-under, src/test)
-LOCAL_JAR_MANIFEST := etc/ahat-tests.mf
-LOCAL_JAVA_RESOURCE_FILES := \
- $(LOCAL_PATH)/etc/test-dump.hprof \
- $(LOCAL_PATH)/etc/test-dump-base.hprof \
- $(LOCAL_PATH)/etc/test-dump.map \
- $(AHAT_RI_TEST_DUMP_HPROF) \
- $(LOCAL_PATH)/etc/L.hprof \
- $(LOCAL_PATH)/etc/O.hprof \
- $(LOCAL_PATH)/etc/RI.hprof
-LOCAL_STATIC_JAVA_LIBRARIES := ahat junit-host
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := ahat-tests
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/../../NOTICE
-LOCAL_TEST_CONFIG := ahat-tests.xml
-LOCAL_COMPATIBILITY_SUITE := general-tests
-include $(BUILD_HOST_JAVA_LIBRARY)
-AHAT_TEST_JAR := $(LOCAL_BUILT_MODULE)
-
-# Clean up local variables.
-AHAT_TEST_JAR :=
-
-AHAT_RI_TEST_DUMP_JAR :=
-AHAT_RI_TEST_DUMP_COMMON :=
-AHAT_RI_TEST_DUMP_HPROF :=
diff --git a/tools/ahat/ahat-tests.xml b/tools/ahat/ahat-tests.xml
deleted file mode 100644
index b07905a9a7..0000000000
--- a/tools/ahat/ahat-tests.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2018 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<configuration description="Runs the ahat unit tests">
- <option name="test-suite-tag" value="ahat" />
- <option name="test-suite-tag" value="art-tools" />
- <option name="null-device" value="true" />
- <test class="com.android.tradefed.testtype.HostTest" >
- <option name="class" value="com.android.ahat.AhatTestSuite" />
- </test>
-</configuration>
diff --git a/tools/ahat/etc/Android.bp b/tools/ahat/etc/Android.bp
new file mode 100644
index 0000000000..dd38518a36
--- /dev/null
+++ b/tools/ahat/etc/Android.bp
@@ -0,0 +1,30 @@
+//
+// Copyright (C) 2025 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package {
+ default_applicable_licenses: ["art_license"],
+}
+
+filegroup {
+ name: "ahat-tests-res",
+ srcs: [
+ "test-dump.hprof",
+ "test-dump-base.hprof",
+ "test-dump.map",
+ "L.hprof",
+ "O.hprof",
+ "RI.hprof",
+ ],
+}