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: "vendor", 23 rustlibs: [ 24 "libciborium", 25 "libenv_logger", 26 "libhex", 27 "libkmr_common", 28 "libkmr_ta", 29 "libkmr_wire", 30 "liblazy_static", 31 "liblog_rust", 32 "libx509_cert" 33 ], 34 proc_macros: [ 35 "libkmr_derive", 36 ], 37 cfgs: [ 38 "soong", 39 ], 40} 41 42rust_library_host { 43 name: "libkmr_tests", 44 crate_name: "kmr_tests", 45 srcs: ["src/lib.rs"], 46 vendor_available: true, 47 defaults: [ 48 "kmr_tests_defaults", 49 ], 50} 51 52// TODO(b/204562227): Rust host unit tests work locally but fail in CI. 53//rust_test_host { 54// name: "libkmr_keyblob_test", 55// srcs: ["tests/keyblob_test.rs"], 56// defaults: [ 57// "kmr_tests_defaults", 58// ], 59// rustlibs: [ 60// "libkmr_crypto_boring", 61// ], 62//} 63 64rust_binary_host { 65 name: "kmr_auth_keyblob_parse", 66 crate_name: "kmr_auth_keyblob_parse", 67 srcs: ["src/bin/auth-keyblob-parse.rs"], 68 defaults: [ 69 "kmr_tests_defaults", 70 ], 71 rustlibs: [ 72 "libkmr_crypto_boring", 73 ], 74} 75 76rust_binary_host { 77 name: "kmr_encrypted_keyblob_parse", 78 crate_name: "kmr_encrypted_keyblob_parse", 79 srcs: ["src/bin/encrypted-keyblob-parse.rs"], 80 defaults: [ 81 "kmr_tests_defaults", 82 ], 83} 84