blob: 87055aa49216a0e729afbbf6af312e289c070565 [file] [log] [blame]
{{>copyright comment="#"}}
{{>generated comment="#"}}
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
group("{{PROJECT_NAME}}") {
testonly = true
deps = [
":pkg",
":tests",
]
}
group("tests") {
testonly = true
deps = [ ":{{PROJECT_NAME}}-tests" ]
}
rustc_binary("bin") {
name = "{{PROJECT_NAME}}"
# Generates a GN target for unit-tests with the label `bin_test`, and
# a binary named `{{snake_case PROJECT_NAME}}_bin_test`.
with_unit_tests = true
deps = [
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
]
}
package("pkg") {
package_name = "{{PROJECT_NAME}}"
deps = [ ":bin" ]
binaries = [
{
name = "{{snake_case PROJECT_NAME}}"
dest = "{{PROJECT_NAME}}"
},
]
meta = [
# Compile the package's CML manifest.
# The resulting component manifest can be referenced through the URL
# fuchsia-pkg://fuchsia.com/{{PROJECT_NAME}}#meta/{{PROJECT_NAME}}.cm.
{
path = rebase_path("meta/{{PROJECT_NAME}}.cml")
dest = "{{PROJECT_NAME}}.cm"
},
]
}
# Run with `fx test {{PROJECT_NAME}}-tests`.
test_package("{{PROJECT_NAME}}-tests") {
deps = [
":bin_test",
"//src/sys/test_adapters/rust",
]
binaries = [
{
name = "rust_test_adapter"
},
]
v2_tests = [
{
name = "{{snake_case PROJECT_NAME}}_bin_test"
dest = "{{PROJECT_NAME}}_test"
environments = basic_envs
},
]
}