jsoncpp icon indicating copy to clipboard operation
jsoncpp copied to clipboard

Add Bazel tests

Open bcsgh opened this issue 8 months ago • 1 comments

  • Tweak runjsontests.py to allow passing single test case files (which s way easier to get than a dir name under Bazel).
  • Add tests to the Bazel builds.

Note:

  • This is on top of https://github.com/open-source-parsers/jsoncpp/pull/1600
  • Because Bazle doesn't allow directly referencing source file from test rules (the path they end up in is an implementation detail) it ends up harder to find the directory that contains the test cases than to find the path for a single test case. To deal with that, this PR creates one test rule per test case so that each command only need the actual file path. That ends up looking a little odd, but is has the collateral benefit of surfacing exactly what does, doesn't work.

Testing:

This pass with all 4 combinations:

for i in true false ; do
  for e in true false ; do
    bazel test --@//:use_exception=${e} --@//:has_int64=${i} ...
  done
done

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.

bcsgh avatar Mar 17 '25 00:03 bcsgh

Poke? (but #1600 first)

bcsgh avatar Apr 10 '25 04:04 bcsgh