-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 Bazel tests #1601
base: master
Are you sure you want to change the base?
Add Bazel tests #1601
Conversation
…th 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.
d13b741
to
0383d14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is in Draft still but here's some early feedback.
test/runjsontests.py
Outdated
tests = [ | ||
test for test in tests | ||
if os.path.basename(test) not in known and | ||
os.path.basename(os.path.dirname(test)) == "jsonchecker" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we add this check here for "jsonchecker", then tests
only consists of jsonchecker
tests, meaning that the line check on 113 is no longer needed, since is_json_checker_test
is always True
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. (Most of the tests were incorrectly no-ops.) Fixed.
exports_files(["LICENSE"]) | ||
|
||
bool_flag( | ||
name = "use_exception", | ||
build_setting_default = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceptions should be on by default, I believe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an abstract question, that's debatable (as in there are good arguments either way). But, given that the existing Bazel build has them off by default, I think backwards compatibility requires keeping them that way.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also: probably a discussion that should be on the record of #1601 (unless you want to merge just this PR and not that one).
runjsontests.py
to allow passing single test case files (which s way easier to get than a dir name under Bazel).Note:
Testing:
This pass with all 4 combinations:
While working on this, I intentionally broke a pass and fail test in each directory to be sure those resulted in a failing test rule, and they did.