diff --git a/Makefile b/Makefile index 92623b7d..dc41049c 100644 --- a/Makefile +++ b/Makefile @@ -52,24 +52,34 @@ MANPAGES := mdbx_stat.1 mdbx_copy.1 mdbx_dump.1 mdbx_load.1 SHELL := /bin/bash ifdef MSVC + UNAME := Windows LCK_IMPL := windows TEST_OSAL := windows + TEST_ITER := 42 else + UNAME := $(shell uname -s 2>/dev/null || echo Unknown) define uname2lck - case "`uname -s 2>/dev/null`" in + case "$(UNAME)" in Linux) echo linux;; - CYGWIN*|MINGW32*|MSYS*) echo windows;; + CYGWIN*|MINGW32*|MSYS*|Windows*) echo windows;; *) echo posix;; esac endef define uname2osal - case "`uname -s 2>/dev/null`" in - CYGWIN*|MINGW32*|MSYS*) echo windows;; + case "$(UNAME)" in + CYGWIN*|MINGW32*|MSYS*|Windows*) echo windows;; *) echo unix;; esac endef + define uname2titer + case "$(UNAME)" in + Darwin*|Mach*) echo 3;; + *) echo 42;; + esac + endef LCK_IMPL := $(shell $(uname2lck)) TEST_OSAL := $(shell $(uname2osal)) + TEST_ITER := $(shell $(uname2titer)) endif CORE_SRC := src/lck-$(LCK_IMPL).c $(filter-out $(wildcard src/lck-*.c), $(wildcard src/*.c)) @@ -104,7 +114,7 @@ clean: rm -rf $(TOOLS) mdbx_test @* *.[ao] *.[ls]o *~ tmp.db/* *.gcov *.log *.err src/*.o test/*.o check: all - rm -f $(TESTDB) $(TESTLOG) && (set -o pipefail; ./mdbx_test --repeat=42 --pathname=$(TESTDB) --dont-cleanup-after basic | tee -a $(TESTLOG) | tail -n 42) \ + rm -f $(TESTDB) $(TESTLOG) && (set -o pipefail; ./mdbx_test --repeat=$(TEST_ITER) --pathname=$(TESTDB) --dont-cleanup-after basic | tee -a $(TESTLOG) | tail -n 42) \ && ./mdbx_chk -vvn $(TESTDB) && ./mdbx_chk -vvn $(TESTDB)-copy check-singleprocess: all diff --git a/test/ttl.cc b/test/ttl.cc index 1ce8d4b7..b2650f0c 100644 --- a/test/ttl.cc +++ b/test/ttl.cc @@ -53,11 +53,26 @@ bool testcase_ttl::run() { */ /* LY: для параметризации используем подходящие параметры, которые не имеют - * здесь смысла в первоначальном значении */ - const unsigned window_max = - (config.params.batch_read > 999) ? config.params.batch_read : 1000; - const unsigned count_max = - (config.params.batch_write > 999) ? config.params.batch_write : 1000; + * здесь смысла в первоначальном значении. */ + const unsigned window_max_lower = +#ifdef __APPLE__ + 333; +#else + 999; +#endif + const unsigned count_max_lower = +#ifdef __APPLE__ + 333; +#else + 999; +#endif + + const unsigned window_max = (config.params.batch_read > window_max_lower) + ? config.params.batch_read + : window_max_lower; + const unsigned count_max = (config.params.batch_write > count_max_lower) + ? config.params.batch_write + : count_max_lower; log_info("ttl: using `batch_read` value %u for window_max", window_max); log_info("ttl: using `batch_write` value %u for count_max", count_max);