1// 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 15package { 16 default_applicable_licenses: ["system_keymint_license"], 17} 18 19rust_defaults { 20 name: "kmr_tests_defaults", 21 edition: "2021", 22 lints: "android", 23 rustlibs: [ 24 "libciborium", 25 "libenv_logger", 26 "libhex", 27 "libkmr_common", 28 "libkmr_ta", 29 "libkmr_wire", 30 "liblog_rust", 31 "libx509_cert" 32 ], 33 proc_macros: [ 34 "libkmr_derive", 35 ], 36 cfgs: [ 37 "soong", 38 ], 39} 40 41rust_library_host { 42 name: "libkmr_tests", 43 crate_name: "kmr_tests", 44 srcs: ["src/lib.rs"], 45 vendor_available: true, 46 defaults: [ 47 "kmr_tests_defaults", 48 ], 49} 50 51rust_test_host { 52 name: "libkmr_keyblob_test", 53 srcs: ["tests/keyblob_test.rs"], 54 defaults: [ 55 "kmr_tests_defaults", 56 ], 57 rustlibs: [ 58 "libkmr_crypto_boring", 59 ], 60 test_suites: ["general-tests"], 61} 62 63rust_binary_host { 64 name: "kmr_auth_keyblob_parse", 65 crate_name: "kmr_auth_keyblob_parse", 66 srcs: ["src/bin/auth-keyblob-parse.rs"], 67 defaults: [ 68 "kmr_tests_defaults", 69 ], 70 rustlibs: [ 71 "libkmr_crypto_boring", 72 ], 73} 74 75rust_binary_host { 76 name: "kmr_encrypted_keyblob_parse", 77 crate_name: "kmr_encrypted_keyblob_parse", 78 srcs: ["src/bin/encrypted-keyblob-parse.rs"], 79 defaults: [ 80 "kmr_tests_defaults", 81 ], 82} 83