From fd8037bac9fe36ae477e32f9dd27cbcb9318b04a Mon Sep 17 00:00:00 2001 From: kn Date: Thu, 28 Dec 2023 00:57:07 +0000 Subject: [PATCH] Fix tests The "only 4 tests that try to git clone fail" comment is wrong, most of the 91 tests fail fetching data; https://github.com/nlohmann/json/pull/2202 from 2020 added an option to use prefetched test data and skip git usage, so do that and have 87/87 tests pass (on amd64). --- textproc/nlohmann-json/Makefile | 18 +++++++++++++----- textproc/nlohmann-json/distinfo | 6 ++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/textproc/nlohmann-json/Makefile b/textproc/nlohmann-json/Makefile index 06e228ad5d9d..e66f7164674e 100644 --- a/textproc/nlohmann-json/Makefile +++ b/textproc/nlohmann-json/Makefile @@ -2,10 +2,11 @@ COMMENT = JSON for modern C++ # the "release" contain only json.hpp, and we want tests and CMake config file V = 3.11.2 -GH_ACCOUNT = nlohmann -GH_PROJECT = json -GH_TAGNAME = v${V} -DISTNAME = nlohmann-json-${V} +DIST_TUPLE = github nlohmann json v${V} . +PKGNAME = nlohmann-json-${V} + +TEST_DATA_DIR = tests/test_data +DIST_TUPLE += github nlohmann json_test_data v3.1.0 ${TEST_DATA_DIR} CATEGORIES = devel textproc @@ -19,10 +20,17 @@ COMPILER = base-clang ports-gcc MODULES = devel/cmake +CONFIGURE_ARGS = -DJSON_TestDataDirectory=${WRKSRC}/${TEST_DATA_DIR} + # only tests are built, defer compilation to running tests NO_BUILD = Yes -# only 4 tests that try to git clone fail + pre-test: @${MODCMAKE_BUILD_TARGET} +# overwrite target, devel/cmake MODULE cannot pass ctest(1) arguments +do-test: + # skip known to tail tests + @${MODCMAKE_TEST_TARGET} -LE git_required + .include diff --git a/textproc/nlohmann-json/distinfo b/textproc/nlohmann-json/distinfo index 996895380e99..1526e41c2eca 100644 --- a/textproc/nlohmann-json/distinfo +++ b/textproc/nlohmann-json/distinfo @@ -1,2 +1,4 @@ -SHA256 (nlohmann-json-3.11.2.tar.gz) = 1p+d62p14lgEZcbExREbicTcL6lOOoX80v/NmhQ9knM= -SIZE (nlohmann-json-3.11.2.tar.gz) = 8097673 +SHA256 (nlohmann-json-v3.11.2.tar.gz) = 1p+d62p14lgEZcbExREbicTcL6lOOoX80v/NmhQ9knM= +SHA256 (nlohmann-json_test_data-v3.1.0.tar.gz) = iEseIfOM/WpiwVnxt+Co9RaK5dqqOE7U3AwPpmYPIb0= +SIZE (nlohmann-json-v3.11.2.tar.gz) = 8097673 +SIZE (nlohmann-json_test_data-v3.1.0.tar.gz) = 115036393