| // Copyright (C) 2019 The Android Open Source Project |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| rust_test_host { |
| name: "adevice_test", |
| srcs: [ |
| "src/lib.rs", |
| ], |
| defaults: ["adevice_deps_defaults"], |
| rustlibs: ["libgoogletest_rust"], |
| test_options: { |
| unit_test: true, |
| }, |
| test_suites: ["general-tests"], |
| } |
| |
| rust_binary_host { |
| name: "adevice", |
| srcs: [ |
| "src/main.rs", |
| ], |
| defaults: ["adevice_deps_defaults"], |
| } |
| |
| rust_binary { |
| name: "adevice_fingerprint", |
| srcs: [ |
| "src/adevice_fingerprint.rs", |
| ], |
| defaults: ["adevice_deps_defaults"], |
| static_executable: true, |
| } |
| |
| rust_test { |
| name: "adevice_fingerprint_test", |
| auto_gen_config: true, |
| defaults: ["adevice_deps_defaults"], |
| srcs: [ |
| "src/adevice_fingerprint.rs", |
| ], |
| rustlibs: ["libgoogletest_rust"], |
| static_executable: true, |
| test_suites: ["general-tests"], |
| test_options: { |
| unit_test: true, |
| }, |
| } |
| |
| rust_protobuf { |
| name: "libadevice_proto_rust", |
| crate_name: "adevice_proto", |
| host_supported: true, |
| source_stem: "adevice_proto", |
| protos: [ |
| "src/protos/clientanalytics.proto", |
| "src/protos/user_log.proto", |
| ], |
| } |
| |
| rust_library { |
| name: "libadevice", |
| srcs: ["src/lib.rs"], |
| crate_name: "adevice", |
| defaults: ["adevice_deps_defaults"], |
| host_supported: true, |
| lints: "none", |
| } |
| |
| rust_defaults { |
| name: "adevice_deps_defaults", |
| rustlibs: [ |
| "libadevice_proto_rust", |
| "libanyhow", |
| "libatty", |
| "libclap", |
| "libhex", |
| "libitertools", |
| "librayon", |
| "libregex", |
| "libring", |
| "libserde", |
| "libserde_json", |
| "libtempfile", |
| "libtracing", |
| "libtracing_subscriber", |
| "libwalkdir", |
| "libprotobuf", |
| "libuuid", |
| ], |
| } |
| |
| // Automate as much of the tool invocation testing that we can. |
| // It is still TBD what we will do to inject a product out tree |
| // and a device in CI. |
| sh_test_host { |
| name: "adevice_integration_test", |
| src: "adevice_integration_test.sh", |
| data_bins: [ |
| "adevice", |
| ], |
| test_suites: ["general-tests"], |
| } |
| |
| rust_test { |
| name: "adevice_whole_program_test", |
| auto_gen_config: true, |
| defaults: ["adevice_deps_defaults"], |
| srcs: [ |
| "tests/whole_program_tests.rs", |
| ], |
| rustlibs: [ |
| "libgoogletest_rust", |
| "libadevice", |
| ], |
| static_executable: true, |
| test_suites: ["general-tests"], |
| test_options: { |
| unit_test: true, |
| }, |
| } |
| |
| rust_test { |
| name: "adevice_partial_program_test", |
| auto_gen_config: true, |
| defaults: ["adevice_deps_defaults"], |
| srcs: [ |
| "tests/partial_program_tests.rs", |
| ], |
| rustlibs: [ |
| "libgoogletest_rust", |
| "libadevice", |
| ], |
| static_executable: true, |
| test_suites: ["general-tests"], |
| test_options: { |
| unit_test: true, |
| }, |
| } |