Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jsoncpp_test bazel configuration #1599

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ cc_library(
"include/json/version.h",
"include/json/writer.h",
],
copts = [
"-DJSON_USE_EXCEPTION=0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this could be a breaking change for some users. I think a better way to do this would be: #1600

"-DJSON_HAS_INT64",
],
includes = ["include"],
visibility = ["//visibility:public"],
deps = [":private"],
Expand All @@ -35,3 +31,22 @@ cc_library(
name = "private",
textual_hdrs = ["src/lib_json/json_valueiterator.inl"],
)

cc_binary(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of these should likely be testonly=True and should probably also be in BUILD.bazel files in their respective directories.

name = "jsontestrunner",
srcs = ["src/jsontestrunner/main.cpp"],
includes = ["include"],
deps = [":jsoncpp"],
)

cc_binary(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could just be made to be a cc_test rule. ...

And I got a little carried away check if that was true: #1601

(That said, I'm not 100% happy with how that came out if you want to take a run at making it cleaner.)

name = "jsoncpp_test",
srcs = [
"src/test_lib_json/jsontest.cpp",
"src/test_lib_json/jsontest.h",
"src/test_lib_json/main.cpp",
"src/test_lib_json/fuzz.h",
"src/test_lib_json/fuzz.cpp",
],
deps = [":jsoncpp"],
)
Loading