| # Copyright 2026 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. |
| load(":defs.bzl", "json_validator_valico_test") |
| |
| package(default_applicable_licenses = ["//:license"]) |
| |
| # NOTE: The GN json_validator_valico_test target runs a single shell script |
| # that receives the path to the tool and to an input data directory, then |
| # invokes the tool three times with different inputs. |
| # |
| # This file defines three different test targets instead, since: |
| # |
| # - Data directories cannot be passed to Bazel test targets, only files. |
| # |
| # - The test must use a runfiles library to locate the data files it needs |
| # at runtime, and this also doesn't support directories. |
| # |
| test_suite( |
| name = "tests", |
| tests = [ |
| ":json_validator_valico_base_test", |
| ":json_validator_valico_document_with_comments_test", |
| ":json_validator_valico_schema_with_ref_test", |
| ], |
| visibility = ["//visibility:public"], |
| ) |
| |
| json_validator_valico_test( |
| name = "json_validator_valico_base_test", |
| test_document = "test_document.json", |
| test_schema = "test_schema.json", |
| ) |
| |
| json_validator_valico_test( |
| name = "json_validator_valico_schema_with_ref_test", |
| expect_failure = True, |
| test_document = "test_document.json", |
| test_schema = "test_schema_with_ref.json", |
| ) |
| |
| json_validator_valico_test( |
| name = "json_validator_valico_document_with_comments_test", |
| extra_args = ["--json5"], |
| test_document = "test_document_with_comments.json", |
| test_schema = "test_schema.json", |
| ) |