mdbx-make: добавление цели ctest и её привязка к make check.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev) 2025-01-07 15:18:27 +03:00
parent 16997a88b0
commit 3a02ca88ea

View File

@ -54,6 +54,8 @@ CFLAGS_EXTRA ?=
LD ?= ld LD ?= ld
CMAKE ?= cmake CMAKE ?= cmake
CMAKE_OPT ?= CMAKE_OPT ?=
CTEST ?= ctest
CTEST_OPT ?=
# target directory for `make dist` # target directory for `make dist`
DIST_DIR ?= dist DIST_DIR ?= dist
@ -295,9 +297,13 @@ lib-shared libmdbx.$(SO_SUFFIX): mdbx-dylib.o $(call select_by,MDBX_BUILD_CXX,md
ninja: cmake-build ninja: cmake-build
cmake-build: cmake-build:
@echo "-G Ninja . && cmake --build ." @echo " RUN: cmake -G Ninja && cmake --build"
$(QUIET)mkdir -p @cmake-ninja-build && $(CMAKE) $(CMAKE_OPT) -G Ninja -S . -B @cmake-ninja-build && $(CMAKE) --build @cmake-ninja-build $(QUIET)mkdir -p @cmake-ninja-build && $(CMAKE) $(CMAKE_OPT) -G Ninja -S . -B @cmake-ninja-build && $(CMAKE) --build @cmake-ninja-build
ctest: cmake-build
@echo " RUN: ctest .."
$(QUIET)$(CTEST) --test-dir @cmake-ninja-build --parallel `(nproc | sysctl -n hw.ncpu | echo 2) 2>/dev/null` --schedule-random $(CTEST_OPT)
#> dist-cutoff-begin #> dist-cutoff-begin
ifeq ($(wildcard mdbx.c),mdbx.c) ifeq ($(wildcard mdbx.c),mdbx.c)
#< dist-cutoff-end #< dist-cutoff-end
@ -418,7 +424,7 @@ MDBX_SMOKE_EXTRA ?=
check: DESTDIR = $(shell pwd)/@check-install check: DESTDIR = $(shell pwd)/@check-install
check: CMAKE_OPT = -Werror=dev check: CMAKE_OPT = -Werror=dev
check: smoke-assertion ninja dist install test check: smoke-assertion ninja dist install test ctest
smoke-assertion: MDBX_BUILD_OPTIONS:=$(strip $(MDBX_BUILD_OPTIONS) -DMDBX_FORCE_ASSERTIONS=1 -UNDEBUG -DMDBX_DEBUG=0) smoke-assertion: MDBX_BUILD_OPTIONS:=$(strip $(MDBX_BUILD_OPTIONS) -DMDBX_FORCE_ASSERTIONS=1 -UNDEBUG -DMDBX_DEBUG=0)
smoke-assertion: smoke smoke-assertion: smoke