mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-09-10 13:25:16 -04:00
Add tests to the Bazel builds.
This commit is contained in:
parent
8fcfda4f1c
commit
0383d14b76
6
src/jsontestrunner/BUILD.bazel
Normal file
6
src/jsontestrunner/BUILD.bazel
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
cc_binary(
|
||||||
|
name = "jsontestrunner",
|
||||||
|
srcs = ["main.cpp"],
|
||||||
|
deps = ["//:jsoncpp"],
|
||||||
|
visibility = ["//test:__pkg__"],
|
||||||
|
)
|
11
src/test_lib_json/BUILD.bazel
Normal file
11
src/test_lib_json/BUILD.bazel
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
cc_test(
|
||||||
|
name = "jsoncpp_test",
|
||||||
|
srcs = [
|
||||||
|
"jsontest.cpp",
|
||||||
|
"jsontest.h",
|
||||||
|
"main.cpp",
|
||||||
|
"fuzz.h",
|
||||||
|
"fuzz.cpp",
|
||||||
|
],
|
||||||
|
deps = ["//:jsoncpp"],
|
||||||
|
)
|
22
test/BUILD.bazel
Normal file
22
test/BUILD.bazel
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
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"])]
|
Loading…
x
Reference in New Issue
Block a user