blob: a93c52154fdaf7f1f356ecdda3dd05882fe11657 [file] [log] [blame]
# Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/components.gni")
import("//build/rust/rustc_binary.gni")
import(
"//src/lib/testing/expectation/fuchsia_test_with_expectations_package.gni")
import("//src/lib/testing/expectation/generated_expectations_file.gni")
rustc_binary("bin") {
edition = "2021"
name = "expectation_comparer"
with_unit_tests = true
deps = [
"expectations_matcher",
"ser",
"//sdk/fidl/fuchsia.test:fuchsia.test_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:itertools",
"//third_party/rust_crates:serde_json5",
"//third_party/rust_crates:tracing",
]
test_deps = [
"//src/lib/fuchsia",
"//third_party/rust_crates:tracing",
]
sources = [ "src/main.rs" ]
configs -= [ "//build/config/rust/lints:allow_unused_results" ]
}
fuchsia_component("expectation_comparer") {
manifest = "meta/expectation_comparer.cml"
deps = [ ":bin" ]
}
fuchsia_unittest_component("expectation-unittests") {
deps = [ ":bin_test" ]
manifest = "meta/test_root.cml"
}
fuchsia_test_with_expectations_package("expectation-example-package") {
test_components = [ ":expectation-unittests" ]
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
expectations = "example_expectations.json5"
}
fuchsia_test_with_expectations_package(
"expectation-example-package-just-err-logs-cases") {
test_components = [ ":expectation-unittests" ]
treatment_of_cases_with_error_logs = "RUN_ONLY_CASES_WITH_ERROR_LOGS"
test_specs = {
log_settings = {
max_severity = "ERROR"
}
}
expectations = "example_expectations.json5"
}
fuchsia_test_with_expectations_package(
"expectation-example-package-no-err-logs-cases") {
test_components = [ ":expectation-unittests" ]
treatment_of_cases_with_error_logs = "SKIP_CASES_WITH_ERROR_LOGS"
expectations = "example_expectations.json5"
}
generated_expectations_file("generated_expectations_example") {
includes = [
"example_expectations_part1.json5",
"example_expectations_part2.json5",
]
}
fuchsia_test_with_expectations_package(
"expectation-example-package-generated") {
test_components = [ ":expectation-unittests" ]
treatment_of_cases_with_error_logs = "SKIP_CASES_WITH_ERROR_LOGS"
generated_expectations = ":generated_expectations_example"
}
group("tests") {
testonly = true
deps = [
":expectation-example-package",
":expectation-example-package-generated",
":expectation-example-package-just-err-logs-cases",
":expectation-example-package-no-err-logs-cases",
"preprocess:tests",
"ser:tests",
"tool:tests",
]
}