| # 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_abi" ] |
| script = "verify_identical.sh" |
| args = [ |
| rebase_path( |
| "$root_gen_dir/src/graphics/lib/magma/include/magma_abi/magma.h", |
| root_build_dir), |
| rebase_path("//src/graphics/lib/magma/include/magma_abi/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_abi/magma.h", |
| "//src/graphics/lib/magma/include/magma_abi/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" ] |
| script = "call_expect_error.sh" |
| args = [ |
| rebase_path("$target_gen_dir/{{source_name_part}}-exitcode", |
| root_build_dir), |
| rebase_path("//src/graphics/lib/magma/include/virtio/virtio_magma.h.gen.py", |
| root_build_dir), |
| "fuchsia", |
| "{{source}}", |
| rebase_path("$target_gen_dir/{{source_name_part}}.h", root_build_dir), |
| ] |
| outputs = [ "$target_gen_dir/{{source_name_part}}-exitcode" ] |
| } |
| |
| 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" ] |
| outputs = [ "${target_gen_dir}/diff" ] |
| deps = [ ":icd_manifest" ] |
| } |
| |
| group("codegen") { |
| testonly = true |
| deps = [ |
| ":icd_manifest_compare", |
| ":magma_header_compare", |
| ":magma_ordinal_error_tests", |
| ] |
| } |