Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
The "only 4 tests that try to git clone fail" comment is wrong, most of the
91 tests fail fetching data;  nlohmann/json#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).
  • Loading branch information
klemensn committed Dec 28, 2023
1 parent 23b6d0a commit fd8037b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
18 changes: 13 additions & 5 deletions textproc/nlohmann-json/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 <bsd.port.mk>
6 changes: 4 additions & 2 deletions textproc/nlohmann-json/distinfo
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fd8037b

Please sign in to comment.