#1136·jsoncpp

Different test result with meson and cmake/ninja build?

Author: ClausKleinCreated Feb 4, 2020Updated May 15, 2026
Labelsbugbuild or testingbuild

After cmake build, the default tests are OK

bash
ninja 
....
Testing BuilderTest/settings: OK
Testing IteratorTest/convert: OK
Testing IteratorTest/decrement: OK
Testing IteratorTest/reverseIterator: OK
Testing IteratorTest/distance: OK
Testing IteratorTest/nullValues: OK
Testing IteratorTest/staticStringKey: OK
Testing IteratorTest/names: OK
Testing IteratorTest/indexes: OK
Testing IteratorTest/constness: OK
Testing RValueTest/moveConstruction: OK
Testing FuzzTest/fuzzDoesntCrash: OK
Testing MemberTemplateAs/BehavesSameAsNamedAs: OK
Testing MemberTemplateIs/BehavesSameAsNamedIs: OK
All 114 tests passed

To Reproduce

bash
Claus-MBP:.build-jsoncpp-Debug clausklein$ ninja test
[0/1] Running tests...
Test project /Users/clausklein/Workspace/cpp/.build-jsoncpp-Debug
    Start 1: jsoncpp_readerwriter
1/3 Test #1: jsoncpp_readerwriter ................   Passed    4.36 sec
    Start 2: jsoncpp_readerwriter_json_checker
2/3 Test #2: jsoncpp_readerwriter_json_checker ...***Failed    1.73 sec
    Start 3: jsoncpp_test
3/3 Test #3: jsoncpp_test ........................   Passed    0.02 sec

67% tests passed, 1 tests failed out of 3

Total Test time (real) =   6.15 sec

The following tests FAILED:
	  2 - jsoncpp_readerwriter_json_checker (Failed)
Errors while running CTest
FAILED: CMakeFiles/test.util 
cd /Users/clausklein/Workspace/cpp/.build-jsoncpp-Debug && /opt/local/bin/ctest --force-new-ctest-process
ninja: build stopped: subcommand failed.
Claus-MBP:.build-jsoncpp-Debug clausklein$ 

Expected behavior

bash
Claus-MBP:build clausklein$ ninja test
[0/1] Running all tests.
1/2 unittest_jsoncpp_test                   OK       0.03 s 
2/2 unittest_jsontestrunner                 OK       3.56 s 

Ok:                    2
Expected Fail:         0
Fail:                  0
Unexpected Pass:       0
Skipped:               0
Timeout:               0

Full log written to /Users/clausklein/Workspace/cpp/jsoncpp/build/meson-logs/testlog.txt
Claus-MBP:build clausklein$ 

Desktop (please complete the following information):

  • OSX: Darwin Kernel Version 15.6.0
  • commit edf528edfa66fd02f54f81ae341592f50e61c39f (HEAD -> master, origin/master, origin/HEAD)
  • ninja version ("1.9.0")

Source: open-source-parsers/jsoncpp