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

Use external test data #2081

Merged
merged 16 commits into from
May 4, 2020
Merged

Use external test data #2081

merged 16 commits into from
May 4, 2020

Conversation

nlohmann
Copy link
Owner

@nlohmann nlohmann commented May 3, 2020

This PR removes the test data from this repository and downloads them from an external repository.

Closes #96
Closes #482
Closes #556
Closes #567
Closes #620
Closes #732
Closes #1066
Closes #1184
Closes #1185
Closes #1235
Closes #1497
Closes #1572
Closes #1790

@nlohmann nlohmann linked an issue May 3, 2020 that may be closed by this pull request
@nlohmann nlohmann mentioned this pull request May 3, 2020
@nickaein
Copy link
Contributor

nickaein commented May 3, 2020

On a clean repo, make check command fails since download_test_data command doesn't get executed.

isaac@ubuntu$ make check
make check -C test
make[1]: Entering directory '/home/isaac/nl-json/test'
[CXX]   src/unit-bson.o
src/unit-bson.cpp:37:25: fatal error: test_data.hpp: No such file or directory
compilation terminated.
Makefile:71: recipe for target 'src/unit-bson.o' failed
make[1]: *** [src/unit-bson.o] Error 1
make[1]: Leaving directory '/home/isaac/nl-json/test'
Makefile:64: recipe for target 'check' failed
make: *** [check] Error 2
isaac@ubuntu$

@nlohmann
Copy link
Owner Author

nlohmann commented May 3, 2020

On a clean repo, make check command fails since download_test_data command doesn't get executed.

I am currently moving functionality from the plain Makefile to CMake. The header is generated by CMake, and the dependency to download the test data first is only expressed in CTest.

Some more info on this: The original Makefile was written in times when the project did not use CMake. Right now, I hope that I am the only one relying on the Makefile, and I keep changing it for my only needs, sometimes hardcoding paths on my machine into it. Once this PR is merged, I would like to continue moving more functionality into CMake and thereby streamlining the whole release process which is currently a large Python project...

@nlohmann
Copy link
Owner Author

nlohmann commented May 4, 2020

Also related: #1251

@nlohmann
Copy link
Owner Author

nlohmann commented May 4, 2020

@tuananh
Copy link

tuananh commented May 4, 2020

Awesome! Thanks!

@Mailaender
Copy link

This has the downside that tests will now fail in Linux distribution build environments that have no internet access.

@nlohmann
Copy link
Owner Author

Is this a thing? I mean: having the library, having no internet connection, yet still want to execute the tests?

@Mailaender
Copy link

I had to disable the tests for https://build.opensuse.org/request/show/856756 which is not nice but also not too serious. https://build.opensuse.org/package/rdiff/home:Mailaender:branches:devel:libraries:c_c++/nlohmann_json?linkrev=base&rev=2 is my try to disable the data download modules, but it seems they don't disable the tests that depend on it, but that may more be some kind of ctest problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment