summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSasha Smundak <asmundak@google.com>2019-01-15 19:20:09 -0800
committerSasha Smundak <asmundak@google.com>2019-01-24 17:11:39 -0800
commite47cc645bddb6d86c8453f15ffac4ba368f6f377 (patch)
tree0e01ee3e8b06133f48b4629474b21e588cb57139 /tests
parentf8f692c41cf84097412c22ea4820b3a11f81facc (diff)
downloadlibufdt-e47cc645bddb6d86c8453f15ffac4ba368f6f377.tar.gz
Convert Android.mk file to Android.bp
See build/soong/README.md for more information. Bug: 122332341 Test: treehugger Change-Id: I4a43730987642585eb0b0ff9c0edae94b98e519c
Diffstat (limited to 'tests')
-rw-r--r--tests/apply_verify_multiple_overlay.sh2
-rw-r--r--tests/src/Android.bp109
-rw-r--r--tests/src/Android.mk139
3 files changed, 110 insertions, 140 deletions
diff --git a/tests/apply_verify_multiple_overlay.sh b/tests/apply_verify_multiple_overlay.sh
index 7b748b2..17b54ba 100644
--- a/tests/apply_verify_multiple_overlay.sh
+++ b/tests/apply_verify_multiple_overlay.sh
@@ -25,7 +25,7 @@ dtc -@ -qq -O dtb -o "${tmpdir}/${OVERLAY_DT_4}.dtb" "${IN_DATA_DIR}/${OVERLAY_D
cd $tmpdir
-apply_bin_path="${ANDROID_HOST_BIN_LOCATION}/ufdt_apply_overlay_host"
+apply_bin_path="${ANDROID_HOST_BIN_LOCATION}/ufdt_apply_overlay"
$apply_bin_path "${BASE_DT_NAME}.dtb" "${OVERLAY_DT_1}.dtb" final_dt.dtb > /dev/null
$apply_bin_path final_dt.dtb "${OVERLAY_DT_2}.dtb" final_dt.dtb > /dev/null
$apply_bin_path final_dt.dtb "${OVERLAY_DT_3}.dtb" final_dt.dtb > /dev/null
diff --git a/tests/src/Android.bp b/tests/src/Android.bp
new file mode 100644
index 0000000..cb9ff9e
--- /dev/null
+++ b/tests/src/Android.bp
@@ -0,0 +1,109 @@
+// Copyright (C) 2016 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.
+
+libufdt_tests_cflags = [
+ "-Wall",
+ "-Werror",
+ "-Wno-error=format",
+]
+
+cc_binary_host {
+ name: "ufdt_gen_test_dts",
+ cflags: libufdt_tests_cflags,
+ srcs: ["ufdt_gen_test_dts.c"],
+}
+
+cc_binary {
+ name: "ufdt_apply_overlay",
+ cflags: libufdt_tests_cflags,
+ srcs: [
+ "ufdt_overlay_test_app.c",
+ "util.c",
+ ],
+ static_libs: [
+ "libufdt",
+ "libfdt",
+ "libufdt_sysdeps",
+ ],
+ required: ["dtc"],
+ target: {
+ host: {
+ stl: "none",
+ dist: {
+ targets: ["dist_files"],
+ dir: "libufdt",
+ },
+ },
+ },
+}
+
+cc_binary_host {
+ name: "extract_dtb",
+ cflags: libufdt_tests_cflags,
+ srcs: [
+ "extract_dtb.c",
+ "util.c",
+ ],
+ static_libs: [
+ "libfdt",
+ "libufdt_sysdeps",
+ ],
+ required: ["dtc"],
+ stl: "none",
+ dist: {
+ targets: ["dist_files"],
+ dir: "libufdt",
+ },
+}
+
+cc_binary {
+ name: "fdt_apply_overlay",
+ cflags: libufdt_tests_cflags,
+ srcs: [
+ "fdt_overlay_test_app.c",
+ "util.c",
+ ],
+ static_libs: [
+ "libfdt",
+ "libufdt_sysdeps",
+ ],
+ required: ["dtc"],
+}
+
+cc_binary_host {
+ name: "ufdt_verify_overlay_host",
+ cflags: libufdt_tests_cflags,
+ srcs: ["ufdt_verify_overlay_app.cpp"],
+ static_libs: [
+ "libufdt",
+ "libfdt",
+ "libufdt_sysdeps",
+ "libufdt_verify",
+ ],
+ required: ["dtc"],
+
+}
+
+cc_test {
+ name: "ufdt_verify_overlay",
+ cflags: libufdt_tests_cflags,
+ srcs: ["ufdt_verify_overlay_app.cpp"],
+ static_libs: [
+ "libufdt",
+ "libfdt",
+ "libufdt_sysdeps",
+ "libufdt_verify",
+ ],
+ required: ["dtc"],
+}
diff --git a/tests/src/Android.mk b/tests/src/Android.mk
deleted file mode 100644
index 9ede790..0000000
--- a/tests/src/Android.mk
+++ /dev/null
@@ -1,139 +0,0 @@
-# Copyright (C) 2016 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)
-
-libufdt_tests_cflags := -Wall -Werror
-ifeq ($(HOST_OS),darwin)
-libufdt_tests_cflags += -Wno-error=format
-endif
-
-###################################################
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := ufdt_gen_test_dts
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := ufdt_gen_test_dts.c
-
-include $(BUILD_HOST_EXECUTABLE)
-
-###################################################
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := ufdt_apply_overlay_host
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := ufdt_overlay_test_app.c util.c
-LOCAL_STATIC_LIBRARIES := \
- libufdt \
- libfdt \
- libufdt_sysdeps
-LOCAL_REQUIRED_MODULES := dtc
-LOCAL_CXX_STL := none
-
-include $(BUILD_HOST_EXECUTABLE)
-
-$(call dist-for-goals, dist_files, $(ALL_MODULES.ufdt_apply_overlay_host.BUILT):libufdt/ufdt_apply_overlay)
-
-###################################################
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := ufdt_apply_overlay
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := ufdt_overlay_test_app.c util.c
-LOCAL_STATIC_LIBRARIES := \
- libufdt \
- libfdt \
- libufdt_sysdeps
-LOCAL_REQUIRED_MODULES := dtc
-
-include $(BUILD_EXECUTABLE)
-
-###################################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := fdt_apply_overlay
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := fdt_overlay_test_app.c util.c
-LOCAL_STATIC_LIBRARIES := \
- libfdt \
- libufdt_sysdeps
-LOCAL_REQUIRED_MODULES := dtc
-
-include $(BUILD_HOST_EXECUTABLE)
-
-###################################################
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := extract_dtb
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := extract_dtb.c util.c
-LOCAL_STATIC_LIBRARIES := \
- libfdt \
- libufdt_sysdeps
-LOCAL_REQUIRED_MODULES := dtc
-LOCAL_CXX_STL := none
-
-include $(BUILD_HOST_EXECUTABLE)
-
-$(call dist-for-goals, dist_files, $(ALL_MODULES.extract_dtb.BUILT):libufdt/extract_dtb)
-
-###################################################
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := fdt_apply_overlay
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := fdt_overlay_test_app.c util.c
-LOCAL_STATIC_LIBRARIES := \
- libfdt \
- libufdt_sysdeps
-LOCAL_REQUIRED_MODULES := dtc
-
-include $(BUILD_EXECUTABLE)
-
-###################################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := ufdt_verify_overlay_host
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := ufdt_verify_overlay_app.cpp
-LOCAL_STATIC_LIBRARIES := \
- libufdt \
- libfdt \
- libufdt_sysdeps \
- libufdt_verify
-LOCAL_REQUIRED_MODULES := dtc
-
-include $(BUILD_HOST_EXECUTABLE)
-
-###################################################
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := ufdt_verify_overlay
-LOCAL_CFLAGS := $(libufdt_tests_cflags)
-LOCAL_SRC_FILES := ufdt_verify_overlay_app.cpp
-LOCAL_STATIC_LIBRARIES := \
- libufdt \
- libfdt \
- libufdt_sysdeps \
- libufdt_verify
-LOCAL_REQUIRED_MODULES := dtc
-
-include $(BUILD_NATIVE_TEST)
-
-###################################################