Files
jsoncpp/test/BUILD.bazel
bcsgh 4bcbc6ac05 Add Bazel tests (#1601)
* Expose JSON_USE_EXCEPTION and JSON_HAS_INT64 as Bazel config flags with defaults that match the existing Bazel build.
Switch //:jsoncpp from using copts ro defines for JSON_USE_EXCEPTION and JSON_HAS_INT64 so that rules that depend on it get the same config.
Make src/test_lib_json/fuzz.cpp respect JSON_USE_EXCEPTION.

* #ifdef stuff that should only be used with JSON_USE_EXCEPTION.

* Modify runjsontests.py to allow passing a single test case file.

* Add tests to the Bazel builds.

* Reverse the polarity to fix a bug.

---------

Co-authored-by: Jordan Bayles <bayles.jordan@gmail.com>
2025-11-12 00:01:15 -08:00

21 lines
515 B
Python

filegroup(
name = "expected",
srcs = glob(["data/**", "jsonchecker/**"], exclude=["**/*.json"]),
)
[py_test(
name = "runjson_%s_test" % "_".join(f.split("/")),
srcs = ["runjsontests.py"],
main = "runjsontests.py",
args = [
"--with-json-checker",
"$(location //src/jsontestrunner:jsontestrunner)",
"$(location :%s)" % f,
],
data = [
"//src/jsontestrunner:jsontestrunner",
":expected",
":%s" % f,
],
) for f in glob(["**/*.json"])]