Files
build/tools/aconfig/Android.bp
Mårten Kongstad af3da9d1be aconfig: restructure integration tests
Consolidate integration tests under tests/. Rename build targets to
follow the same pattern.

The important aconfig build targets are:

  - aconfig           : the aconfig binary
  - aconfig.test      : the aconfig unit tests
  - aconfig.test.java : the Java integration tests
  - aconfig.test.cpp  : the C++ integration tests
  - aconfig.test.rust : the Rust integration tests (not implemented yet)

Note: the Rust integration tests are blocked until the build system has
added support for aconfig Rust libraries.

Note: the flags used in the integration are not set correctly. A
follow-up CL will fix this.

Bug: 283911467
Test: atest aconfig.test.java aconfig.test.cpp
Change-Id: Idb8dad4c38a49231c2e89228775bacf065ee1f57
2023-07-24 13:05:43 +02:00

136 lines
2.6 KiB
Plaintext

package {
default_applicable_licenses: ["Android-Apache-2.0"],
}
// proto libraries for consumers of `aconfig dump --format=protobuf` output
java_library {
name: "libaconfig_java_proto_lite",
host_supported: true,
srcs: ["protos/aconfig.proto"],
static_libs: ["libprotobuf-java-lite"],
proto: {
type: "lite",
},
sdk_version: "current",
}
java_library_host {
name: "libaconfig_java_proto_full",
srcs: ["protos/aconfig.proto"],
static_libs: ["libprotobuf-java-full"],
proto: {
type: "full",
},
}
// 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",
],
proc_macros: [
"libpaste",
]
}
rust_binary_host {
name: "aconfig",
defaults: ["aconfig.defaults"],
}
rust_test_host {
name: "aconfig.test",
defaults: ["aconfig.defaults"],
rustlibs: [
"libitertools",
],
}
// integration tests: general
aconfig_declarations {
name: "aconfig.test.flags",
package: "com.android.aconfig.test",
srcs: ["tests/test.aconfig"],
}
aconfig_values {
name: "aconfig.test.flag.values",
package: "com.android.aconfig.test",
srcs: [
"tests/first.values",
"tests/second.values",
],
}
aconfig_value_set {
name: "aconfig.test.flag.value_set",
values: [
"aconfig.test.flag.values",
],
}
// integration tests: java
java_aconfig_library {
name: "aconfig_test_java_library",
aconfig_declarations: "aconfig.test.flags",
}
android_test {
name: "aconfig.test.java",
srcs: [
"tests/**/*.java",
],
manifest: "tests/AndroidManifest.xml",
certificate: "platform",
static_libs: [
"aconfig_test_java_library",
"androidx.test.rules",
"testng",
],
test_suites: ["device-tests"],
}
// integration tests: C++
cc_aconfig_library {
name: "aconfig_test_cpp_library",
aconfig_declarations: "aconfig.test.flags",
}
cc_test {
name: "aconfig.test.cpp",
srcs: [
"tests/aconfig_test.cpp",
],
static_libs: [
"aconfig_test_cpp_library",
"libgmock",
],
shared_libs: [
"server_configurable_flags",
],
}