Add integration tests for Java. This test setup verifies that - the build system calls aconfig to generate a Java library - the Java test compiles against the auto-generated library - the auto-generated code returns expected values Similar integration tests for C++ and Rust will be added in follow-up CLs. Note: the build does not currently support specifying that tests/*.values should be applied, so the test flags will all be assigned the defaults. A later CL will fix this. Bug: b/283911467 Test: atest aconfig.test aconfig.test.java Change-Id: Ia365e209261f4935a23e2dac9ef0ab5b60f76e52
83 lines
1.6 KiB
Plaintext
83 lines
1.6 KiB
Plaintext
package {
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
}
|
|
|
|
// host binary: aconfig
|
|
|
|
rust_protobuf_host {
|
|
name: "libaconfig_protos",
|
|
protos: ["protos/aconfig.proto"],
|
|
crate_name: "aconfig_protos",
|
|
source_stem: "aconfig_protos",
|
|
use_protobuf3: true,
|
|
}
|
|
|
|
rust_defaults {
|
|
name: "aconfig.defaults",
|
|
edition: "2021",
|
|
clippy_lints: "android",
|
|
lints: "android",
|
|
srcs: ["src/main.rs"],
|
|
rustlibs: [
|
|
"libaconfig_protos",
|
|
"libanyhow",
|
|
"libclap",
|
|
"libprotobuf",
|
|
"libserde",
|
|
"libserde_json",
|
|
"libtinytemplate",
|
|
],
|
|
}
|
|
|
|
rust_binary_host {
|
|
name: "aconfig",
|
|
defaults: ["aconfig.defaults"],
|
|
}
|
|
|
|
rust_test_host {
|
|
name: "aconfig.test",
|
|
defaults: ["aconfig.defaults"],
|
|
rustlibs: [
|
|
"libitertools",
|
|
],
|
|
}
|
|
|
|
// integration tests: java
|
|
|
|
device_config_definitions {
|
|
name: "aconfig.test.flags",
|
|
namespace: "com.android.aconfig.test",
|
|
srcs: ["tests/test.aconfig"],
|
|
}
|
|
|
|
device_config_values {
|
|
name: "aconfig.test.flag.values",
|
|
namespace: "com.android.aconfig.test",
|
|
srcs: [
|
|
"tests/first.values",
|
|
"tests/second.values",
|
|
],
|
|
}
|
|
|
|
device_config_value_set {
|
|
name: "aconfig.test.flag.value_set",
|
|
values: [
|
|
"aconfig.test.flag.values",
|
|
],
|
|
}
|
|
|
|
android_test {
|
|
name: "aconfig.test.java",
|
|
srcs: [
|
|
"tests/**/*.java",
|
|
":aconfig.test.flags{.srcjar}",
|
|
],
|
|
manifest: "tests/AndroidManifest.xml",
|
|
certificate: "platform",
|
|
static_libs: [
|
|
"androidx.test.rules",
|
|
"testng",
|
|
],
|
|
test_suites: ["device-tests"],
|
|
}
|