1package { 2 default_applicable_licenses: ["Android-Apache-2.0"], 3} 4 5rust_library { 6 name: "liblogger", 7 host_supported: true, 8 crate_name: "logger", 9 srcs: ["logger.rs"], 10 rustlibs: [ 11 "libenv_logger", 12 "liblog_rust", 13 ], 14 target: { 15 android: { 16 rustlibs: [ 17 "libandroid_logger", 18 ] 19 }, 20 }, 21} 22 23rust_library { 24 name: "liblog_event_list", 25 crate_name: "log_event_list", 26 srcs: ["liblog_event_list.rs"], 27 rustlibs: ["liblog_event_list_bindgen"], 28 shared_libs: ["liblog"], 29} 30 31rust_defaults { 32 name: "liblogger_test_defaults", 33 crate_name: "logger", 34 test_suites: ["general-tests"], 35 auto_gen_config: true, 36 rustlibs: [ 37 "liblogger", 38 "liblog_rust", 39 ] 40} 41 42rust_test { 43 name: "logger_device_unit_tests", 44 defaults: ["liblogger_test_defaults"], 45 srcs: ["logger.rs"], 46 rustlibs: [ 47 "libenv_logger", 48 "libandroid_logger" 49 ] 50} 51 52rust_test_host { 53 name: "logger_host_unit_tests", 54 defaults: ["liblogger_test_defaults"], 55 srcs: ["logger.rs"], 56 rustlibs: ["libenv_logger"] 57} 58 59// The following tests are each run as separate targets because they all require a clean init state. 60rust_test { 61 name: "logger_device_test_default_init", 62 defaults: ["liblogger_test_defaults"], 63 srcs: ["tests/default_init.rs"], 64} 65 66rust_test_host { 67 name: "logger_host_test_default_init", 68 defaults: ["liblogger_test_defaults"], 69 srcs: ["tests/default_init.rs"], 70} 71 72rust_test { 73 name: "logger_device_test_env_log_level", 74 defaults: ["liblogger_test_defaults"], 75 srcs: ["tests/env_log_level.rs"], 76} 77 78rust_test_host { 79 name: "logger_host_test_env_log_level", 80 defaults: ["liblogger_test_defaults"], 81 srcs: ["tests/env_log_level.rs"], 82} 83 84rust_test { 85 name: "logger_device_test_config_log_level", 86 defaults: ["liblogger_test_defaults"], 87 srcs: ["tests/config_log_level.rs"], 88} 89 90rust_test_host { 91 name: "logger_host_test_config_log_level", 92 defaults: ["liblogger_test_defaults"], 93 srcs: ["tests/config_log_level.rs"], 94} 95 96rust_test { 97 name: "logger_device_test_multiple_init", 98 defaults: ["liblogger_test_defaults"], 99 srcs: ["tests/multiple_init.rs"], 100} 101 102rust_test_host { 103 name: "logger_host_test_multiple_init", 104 defaults: ["liblogger_test_defaults"], 105 srcs: ["tests/multiple_init.rs"], 106} 107