blob: 8f9e955748389fcb446919fb73e77286153fec1b [file] [log] [blame]
# Copyright 2019 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.
# The tests in this path are used for validating generated code, especially
# for those files that are not otherwise automatically rebuilt.
action("magma_header_compare") {
testonly = true
deps = [ "//src/graphics/lib/magma/include/magma:magma_header_gen" ]
script = "verify_identical.sh"
args = [
rebase_path("$root_gen_dir/src/graphics/lib/magma/include/magma/magma.h",
root_build_dir),
rebase_path("//sdk/lib/magma_client/include/lib/magma/magma.h",
root_build_dir),
rebase_path("$target_gen_dir/magma.h.compare_out", root_build_dir),
]
inputs = [
"$root_gen_dir/src/graphics/lib/magma/include/magma/magma.h",
"//sdk/lib/magma_client/include/lib/magma/magma.h",
]
outputs = [ "$target_gen_dir/magma.h.compare_out" ]
}
action_foreach("magma_ordinal_error_tests") {
# This target validates that the virtio_magma_h_generation script catches ordinal errors.
testonly = true
sources = [
"magma_bad-next-free.json",
"magma_ordinal-collision.json",
"magma_ordinal-overflow.json",
]
inputs = [ "//src/graphics/lib/magma/include/virtio/virtio_magma_h_gen.py" ]
_header_file = "$target_gen_dir/{{source_name_part}}.h"
_exit_code_file = "$target_gen_dir/{{source_name_part}}-exitcode"
script = "call_expect_error.sh"
args = [
rebase_path(_exit_code_file, root_build_dir),
rebase_path("//src/graphics/lib/magma/include/virtio/virtio_magma_h_gen.py",
root_build_dir),
rebase_path(python_exe_src, root_build_dir),
"fuchsia",
"{{source}}",
rebase_path(_header_file, root_build_dir),
]
outputs = [
_exit_code_file,
_header_file,
]
}
generated_icd_manifest_file = "${target_gen_dir}/test_manifest.json"
action("icd_manifest") {
testonly = true
script = "//src/graphics/lib/magma/scripts/gen_icd_manifest.sh"
args = [
"path/to/ICD/library.so",
rebase_path(generated_icd_manifest_file, root_build_dir),
]
outputs = [ generated_icd_manifest_file ]
}
action("icd_manifest_compare") {
testonly = true
script = "//src/graphics/lib/magma/scripts/diff_json.py"
args = [
rebase_path("vulkan_reference_icd_manifest.json", root_build_dir),
rebase_path(generated_icd_manifest_file, root_build_dir),
rebase_path("${target_gen_dir}/diff", root_build_dir),
]
inputs = [
"vulkan_reference_icd_manifest.json",
generated_icd_manifest_file,
]
outputs = [ "${target_gen_dir}/diff" ]
deps = [ ":icd_manifest" ]
}
group("codegen") {
testonly = true
deps = [
":icd_manifest_compare",
":magma_header_compare",
":magma_ordinal_error_tests",
]
}