blob: c59b8c9533653170ec09afd0e452ae9e18de0d64 [file]
# Copyright 2023 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.
# LINT.IfChange
# Generates an expectations JSON5 file from a list of expectation files to
# include. All test cases without matching expectations will be expected to
# pass by default.
#
# Parameters
# includes (required)
# A list of expectation files to include.
# Type: list of paths
template("generated_expectations_file") {
generated_file(target_name) {
forward_variables_from(invoker,
[
"testonly",
"visibility",
])
output_file = "${target_gen_dir}/${target_name}.json5"
outputs = [ output_file ]
output_conversion = "json"
contents = {
actions = [
{
include = "//src/lib/testing/expectation/default_expectations.json5"
},
]
}
foreach(include, invoker.includes) {
contents.actions += [
{
include = get_path_info(include, "abspath")
},
]
}
}
}
# LINT.ThenChange(//src/lib/testing/expectation/rules/fx_generated_expectations.bzl)