blob: 32c39dc1b2f051e1f1b23c2f8351c685088e534c [file] [log] [blame]
Rajesh Nyamagoudb881d512021-12-10 00:33:15 +00001// Copyright 2022, 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
Bob Badourae667ea2022-05-19 09:15:17 -070015package {
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_security_license"
19 // to get the below license kinds:
20 // SPDX-license-identifier-Apache-2.0
21 default_applicable_licenses: ["system_security_license"],
22}
23
Rajesh Nyamagoudb881d512021-12-10 00:33:15 +000024rust_test {
25 name: "keystore2_client_tests",
26 defaults: [
27 "keymint_use_latest_hal_aidl_rust",
28 "keystore2_use_latest_aidl_rust",
29 ],
30 srcs: ["keystore2_client_tests.rs"],
31 test_suites: [
32 "general-tests",
33 ],
34 test_config: "AndroidTest.xml",
35
36 rustlibs: [
37 "librustutils",
38 "libkeystore2_test_utils",
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000039 "packagemanager_aidl-rust",
Rajesh Nyamagoudb881d512021-12-10 00:33:15 +000040 "libnix",
41 "libanyhow",
42 "libbinder_rs",
43 "liblazy_static",
44 "liblibc",
45 "libserde",
46 "libthiserror",
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000047 "libcxx",
48 "libopenssl",
Rajesh Nyamagoud4d483372022-02-09 01:38:23 +000049 ],
50 static_libs: [
51 "libkeystore2_ffi_test_utils",
52 "libgtest",
53 "libkeymint_vts_test_utils",
54 ],
55 shared_libs: [
56 "libcrypto",
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000057 "libkeymaster_portable",
58 "libkeymaster_messages",
59 "libcppbor_external",
Rajesh Nyamagoud28abde62023-04-01 01:32:32 +000060 "libkeystore-engine",
Rajesh Nyamagouda42dee62022-04-22 21:15:55 +000061 "libkeymint_support",
Rajesh Nyamagoudb881d512021-12-10 00:33:15 +000062 ],
63 require_root: true,
64}
Rajesh Nyamagoud4d483372022-02-09 01:38:23 +000065
66cc_library_static {
67 name: "libkeystore2_ffi_test_utils",
68 srcs: ["ffi_test_utils.cpp"],
69 defaults: [
70 "keymint_vts_defaults",
71 "hidl_defaults",
72 ],
73 generated_headers: [
74 "cxx-bridge-header",
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000075 "libkeystore2_ffi_test_utils_bridge_header",
Rajesh Nyamagoud4d483372022-02-09 01:38:23 +000076 ],
77 generated_sources: ["libkeystore2_ffi_test_utils_bridge_code"],
78 static_libs: [
79 "libkeymint_vts_test_utils",
80 ],
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000081 shared_libs: [
82 "libkeymaster_portable",
83 "libkeymaster_messages",
84 "libcppbor_external",
Rajesh Nyamagoud28abde62023-04-01 01:32:32 +000085 "libkeystore-engine",
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000086 ],
Rajesh Nyamagoud4d483372022-02-09 01:38:23 +000087}
88
89genrule {
90 name: "libkeystore2_ffi_test_utils_bridge_code",
91 tools: ["cxxbridge"],
92 cmd: "$(location cxxbridge) $(in) >> $(out)",
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000093 srcs: ["ffi_test_utils.rs"],
Rajesh Nyamagoud4d483372022-02-09 01:38:23 +000094 out: ["libkeystore2_test_utils_cxx_generated.cc"],
95}
Rajesh Nyamagoudc946cc42022-04-12 22:49:11 +000096
97genrule {
98 name: "libkeystore2_ffi_test_utils_bridge_header",
99 tools: ["cxxbridge"],
100 cmd: "$(location cxxbridge) $(in) --header >> $(out)",
101 srcs: ["ffi_test_utils.rs"],
102 out: ["ffi_test_utils.rs.h"],
103}