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

make check - no test ran #767

Closed
emazv72 opened this issue Oct 6, 2017 · 12 comments
Closed

make check - no test ran #767

emazv72 opened this issue Oct 6, 2017 · 12 comments
Labels
platform: mingw related to MinGW

Comments

@emazv72
Copy link

emazv72 commented Oct 6, 2017

Symptom: Running make check doesn't run any test on my environment.

$ make check
make check -C test
make[1]: Entering directory '/hbdev/test/ziplib/json/test'
Executing test-json_patch...
===============================================================================
No tests ran

The issue seems to be in test/Makefile

if I replace

TEST_PATTERN ?= "*"

with

TEST_PATTERN ?= ""

The issue seems fixed

OS: Windows 10
Plat: MSYS2 - GNU Make 4.2.1 - gcc version 7.2.0 (Rev1, Built by MSYS2 project)

Thanks

@nlohmann
Copy link
Owner

nlohmann commented Oct 6, 2017

Thanks for reporting. We recently switched to Cmake to compile/execute the test suite, so you could also try

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ ctest

However, we did not change the existing Makefile, and pattern * should be ok... Strange...

Anyway, please try with cmake/ctest.

@nlohmann
Copy link
Owner

nlohmann commented Oct 7, 2017

I cannot reproduce the issue. make check executes the test suite without problems. Changing TEST_PATTERN ?= "" is wrong: it would give make check the same behavior as make check-fast to only execute a smaller test suite.

@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Oct 7, 2017
@emazv72
Copy link
Author

emazv72 commented Oct 13, 2017

Thanks Niel for your time. I didn't have much time to dig into make issues, so I switched to cmake, can build successfully on develop branch now.

After running the the test suite I've the following failures:

35 - test-inspection_default (Failed)
61 - test-regression_default (Failed)
65 - test-testsuites_default (Failed)

Building on master branch gives me the following errors:

Scanning dependencies of target catch_main
[ 2%] Building CXX object test/CMakeFiles/catch_main.dir/src/unit.cpp.o
[ 2%] Built target catch_main
[ 5%] Generating CXX prefix source test/cotire/json_unit_CXX_prefix.cxx
[ 7%] Generating CXX prefix header test/cotire/json_unit_CXX_prefix.hxx
[ 10%] Building CXX precompiled header test/cotire/json_unit_CXX_prefix.hxx.gch
json/build/test/cotire/json_unit_CXX_prefix.hxx:4:10: fatal error: json/build/test/cotire/json_unit_CXX_prefix.cxx: No such file or directory
#include "/build/test/cotire/json_unit_CXX_prefix.cxx"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
CMake Error at /json/cmake/cotire.cmake:1848 (message):
cotire: error 1 precompiling
/build/test/cotire/json_unit_CXX_prefix.hxx.
Call Stack (most recent call first):
/json/cmake/cotire.cmake:3512 (cotire_precompile_prefix_header)

make[2]: *** [test/CMakeFiles/json_unit.dir/build.make:64: test/cotire/json_unit_CXX_prefix.hxx.gch] Error 1
make[1]: *** [CMakeFiles/Makefile2:122: test/CMakeFiles/json_unit.dir/all] Error 2
make: *** [Makefile:139: all] Error 2

@nlohmann
Copy link
Owner

Could you try the develop version?

@emazv72
Copy link
Author

emazv72 commented Oct 17, 2017

Just tested the develop version again and got the following output ( didn't change since last run on develop )

The following tests FAILED:
35 - test-inspection_default (Failed)
61 - test-regression_default (Failed)
65 - test-testsuites_default (Failed)

@nlohmann
Copy link
Owner

Can you please provide the error logs so we can have a look why the tests fail?

@emazv72
Copy link
Author

emazv72 commented Oct 18, 2017

Hope this LastTest.log helps, can't see any other relevant file generated in the build tree.

@nlohmann
Copy link
Owner

Could you please run the tests with

ctest -O test.log --output-on-failure

and attach file test.log?

@emazv72
Copy link
Author

emazv72 commented Oct 18, 2017

This is the test result test.log

@nlohmann
Copy link
Owner

It seems that most errors are due to MingGW's formatting of exponents with a leading zero, cf.

C:/Data/e.zavallone/test/ziplib/json/json/test/src/unit-testsuites.cpp:328: FAILED:
  CHECK( j.dump() == json_string )
with expansion:
  "[1.2345e+030]" == "[1.2345e+30]"
with messages:
  filename := "test/data/json_roundtrip/roundtrip32.json"
  json_string := "[1.2345e+30]"

or

C:/Data/e.zavallone/test/ziplib/json/json/test/src/unit-regression.cpp:772: FAILED:
  CHECK( j.dump() == "1.66020696663386e+20" )
with expansion:
  "1.66020696663386e+020"
  ==
  "1.66020696663386e+20"

We had a ticket on this before, but if I remember correctly, MinGW's behavior is not conformant here.

@nlohmann nlohmann added platform: mingw related to MinGW and removed solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Oct 18, 2017
@emazv72
Copy link
Author

emazv72 commented Oct 19, 2017

The effect of this issue is negligible on my domain. I briefly inspected the other failed test ( parsing in particular ) and they look like corner cases ( like unit-regression.cpp, SECTION("second example from #529") )

I'm going to integrate your library - easy to use and well documented - in my app, thanks for helping me.

@nlohmann
Copy link
Owner

No worries. I really would like to provide better support here, but I found no way yet to run MinGW on a CI server.

In any way - if you need further assistance, just open an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: mingw related to MinGW
Projects
None yet
Development

No branches or pull requests

2 participants