1// Copyright (C) 2016 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
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "system_libufdt_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["system_libufdt_license"],
22}
23
24libufdt_tests_cflags = [
25    "-Wall",
26    "-Werror",
27    "-Wno-error=format",
28]
29
30cc_binary_host {
31    name: "ufdt_gen_test_dts",
32    cflags: libufdt_tests_cflags,
33    srcs: ["ufdt_gen_test_dts.c"],
34}
35
36cc_binary {
37    name: "ufdt_apply_overlay",
38    host_supported: true,
39    cflags: libufdt_tests_cflags,
40    srcs: [
41        "ufdt_overlay_test_app.c",
42        "util.c",
43    ],
44    static_libs: [
45        "libufdt",
46        "libfdt",
47        "libufdt_sysdeps",
48    ],
49    required: ["dtc"],
50    target: {
51        host: {
52            stl: "none",
53            dist: {
54                targets: ["dist_files"],
55                dir: "libufdt",
56            },
57        },
58    },
59}
60
61cc_binary_host {
62    name: "extract_dtb",
63    cflags: libufdt_tests_cflags,
64    srcs: [
65        "extract_dtb.c",
66        "util.c",
67    ],
68    static_libs: [
69        "libfdt",
70        "libufdt_sysdeps",
71    ],
72    required: ["dtc"],
73    stl: "none",
74    dist: {
75        targets: ["dist_files"],
76        dir: "libufdt",
77    },
78}
79
80cc_binary {
81    name: "fdt_apply_overlay",
82    cflags: libufdt_tests_cflags,
83    srcs: [
84        "fdt_overlay_test_app.c",
85        "util.c",
86    ],
87    static_libs: [
88        "libfdt",
89        "libufdt_sysdeps",
90    ],
91    required: ["dtc"],
92}
93
94cc_binary_host {
95    name: "ufdt_verify_overlay_host",
96    cflags: libufdt_tests_cflags,
97    srcs: ["ufdt_verify_overlay_app.cpp"],
98    static_libs: [
99        "libufdt",
100        "libfdt",
101        "libufdt_sysdeps",
102        "libufdt_verify",
103    ],
104    required: ["dtc"],
105
106}
107
108cc_test {
109    name: "ufdt_verify_overlay",
110    cflags: libufdt_tests_cflags,
111    srcs: ["ufdt_verify_overlay_app.cpp"],
112    static_libs: [
113        "libufdt",
114        "libfdt",
115        "libufdt_sysdeps",
116        "libufdt_verify",
117    ],
118    required: ["dtc"],
119    test_suites: ["vts"],
120    auto_gen_config: false,
121}
122