1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "system_tools_hidl_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["system_tools_hidl_license"],
8}
9
10genrule {
11    name: "hidl_hash_test_gen",
12    tools: [
13        "hidl-gen",
14    ],
15    cmd: "set +o pipefail; $(location hidl-gen) -L check " +
16        "    -r android.hidl:system/libhidl/transport" +
17        "    -r test.hash:system/tools/hidl/test/hash_test/correct_hash" +
18        "    [email protected]" +
19        " && " +
20        "!($(location hidl-gen) -F -L check " +
21        "    -r android.hidl:system/libhidl/transport" +
22        "    -r test.hash:system/tools/hidl/test/hash_test/missing_hash" +
23        "    [email protected] 2> /dev/null)" +
24        " && " +
25        "!($(location hidl-gen) -L check " +
26        "    -r android.hidl:system/libhidl/transport" +
27        "    -r test.hash:system/tools/hidl/test/hash_test/incorrect_hash" +
28        "    [email protected] 2> /dev/null)" +
29        " && " +
30        "$(location hidl-gen) -L hash " +
31        "    -r android.hidl:system/libhidl/transport" +
32        "    -r test.hash:system/tools/hidl/test/hash_test/incorrect_hash" +
33        "    [email protected] > /dev/null" +
34        " && " +
35        "echo 'int main(){return 0;}' > $(genDir)/TODO_b_37575883.cpp",
36    out: ["TODO_b_37575883.cpp"],
37
38    srcs: [
39        "correct_hash/current.txt",
40        "correct_hash/hash/1.0/IHash.hal",
41        "incorrect_hash/current.txt",
42        "incorrect_hash/hash/1.0/IHash.hal",
43        "missing_hash/hash/1.0/IUnhashed.hal",
44        ":android.hidl",
45        ":[email protected]_hal",
46        ":checked_in_hidl_current",
47    ],
48}
49
50cc_test_host {
51    name: "hidl_hash_test",
52    cflags: [
53        "-Wall",
54        "-Werror",
55    ],
56    generated_sources: ["hidl_hash_test_gen"],
57    gtest: false,
58}
59