mirror of
https://gitflic.ru/project/erthink/libmdbx.git
synced 2025-02-06 07:15:54 +00:00
mdbx-test: добавление опции --taillog
в стохастический скрипт.
This commit is contained in:
parent
ad4d00677b
commit
07fc7b9227
@ -418,15 +418,15 @@ smoke-fault: build-test
|
|||||||
|
|
||||||
test: build-test
|
test: build-test
|
||||||
@echo ' RUNNING `test/long_stochastic.sh --loops 2`...'
|
@echo ' RUNNING `test/long_stochastic.sh --loops 2`...'
|
||||||
$(QUIET)test/long_stochastic.sh --dont-check-ram-size --loops 2 --db-upto-mb 256 --skip-make >$(TEST_LOG) || (cat $(TEST_LOG) && false)
|
$(QUIET)test/long_stochastic.sh --dont-check-ram-size --loops 2 --db-upto-mb 256 --skip-make --taillog >$(TEST_LOG) || (cat $(TEST_LOG) && false)
|
||||||
|
|
||||||
long-test: build-test
|
long-test: build-test
|
||||||
@echo ' RUNNING `test/long_stochastic.sh --loops 42`...'
|
@echo ' RUNNING `test/long_stochastic.sh --loops 42`...'
|
||||||
$(QUIET)test/long_stochastic.sh --loops 42 --db-upto-mb 1024 --skip-make
|
$(QUIET)test/long_stochastic.sh --loops 42 --db-upto-mb 1024 --skip-make --taillog
|
||||||
|
|
||||||
test-singleprocess: build-test
|
test-singleprocess: build-test
|
||||||
@echo ' RUNNING `test/long_stochastic.sh --single --loops 2`...'
|
@echo ' RUNNING `test/long_stochastic.sh --single --loops 2`...'
|
||||||
$(QUIET)test/long_stochastic.sh --dont-check-ram-size --single --loops 2 --db-upto-mb 256 --skip-make >$(TEST_LOG) || (cat $(TEST_LOG) && false)
|
$(QUIET)test/long_stochastic.sh --dont-check-ram-size --single --loops 2 --db-upto-mb 256 --skip-make --taillog >$(TEST_LOG) || (cat $(TEST_LOG) && false)
|
||||||
|
|
||||||
test-valgrind: CFLAGS_EXTRA=-Ofast -DMDBX_USE_VALGRIND
|
test-valgrind: CFLAGS_EXTRA=-Ofast -DMDBX_USE_VALGRIND
|
||||||
test-valgrind: build-test
|
test-valgrind: build-test
|
||||||
|
@ -13,6 +13,7 @@ DB_UPTO_MB=17408
|
|||||||
PAGESIZE=min
|
PAGESIZE=min
|
||||||
DONT_CHECK_RAM=no
|
DONT_CHECK_RAM=no
|
||||||
EXTRA=no
|
EXTRA=no
|
||||||
|
TAILLOG=0
|
||||||
|
|
||||||
while [ -n "$1" ]
|
while [ -n "$1" ]
|
||||||
do
|
do
|
||||||
@ -35,9 +36,13 @@ do
|
|||||||
echo "--pagesize NN Use specified page size (256 is minimal and used by default)"
|
echo "--pagesize NN Use specified page size (256 is minimal and used by default)"
|
||||||
echo "--dont-check-ram-size Don't check available RAM"
|
echo "--dont-check-ram-size Don't check available RAM"
|
||||||
echo "--extra Iterate extra modes/flags"
|
echo "--extra Iterate extra modes/flags"
|
||||||
|
echo "--taillog Dump tail of test log on failure"
|
||||||
echo "--help Print this usage help and exit"
|
echo "--help Print this usage help and exit"
|
||||||
exit -2
|
exit -2
|
||||||
;;
|
;;
|
||||||
|
--taillog)
|
||||||
|
TAILLOG=999
|
||||||
|
;;
|
||||||
--multi)
|
--multi)
|
||||||
LIST=basic
|
LIST=basic
|
||||||
;;
|
;;
|
||||||
@ -345,14 +350,38 @@ if which lz4 >/dev/null; then
|
|||||||
function logger {
|
function logger {
|
||||||
lz4 > ${TESTDB_DIR}/long.log.lz4
|
lz4 > ${TESTDB_DIR}/long.log.lz4
|
||||||
}
|
}
|
||||||
|
function taillog {
|
||||||
|
if [ -s ${TESTDB_DIR}/long.log.lz4 ]; then
|
||||||
|
echo "=============================================== last ${TAILLOG} lines"
|
||||||
|
lz4 -d -c ${TESTDB_DIR}/long.log.lz4 | tail -n ${TAILLOG}
|
||||||
|
else
|
||||||
|
echo "=============================================== no test log"
|
||||||
|
fi
|
||||||
|
}
|
||||||
elif which gzip >/dev/null; then
|
elif which gzip >/dev/null; then
|
||||||
function logger {
|
function logger {
|
||||||
gzip > ${TESTDB_DIR}/long.log.gz
|
gzip > ${TESTDB_DIR}/long.log.gz
|
||||||
}
|
}
|
||||||
|
function taillog {
|
||||||
|
if [ -s ${TESTDB_DIR}/long.log.gz ]; then
|
||||||
|
echo "=============================================== last ${TAILLOG} lines"
|
||||||
|
gzip -d -c ${TESTDB_DIR}/long.log.gz | tail -n ${TAILLOG}
|
||||||
|
else
|
||||||
|
echo "=============================================== no test log"
|
||||||
|
fi
|
||||||
|
}
|
||||||
else
|
else
|
||||||
function logger {
|
function logger {
|
||||||
cat > ${TESTDB_DIR}/long.log
|
cat > ${TESTDB_DIR}/long.log
|
||||||
}
|
}
|
||||||
|
function taillog {
|
||||||
|
if [ -s ${TESTDB_DIR}/long.log ]; then
|
||||||
|
echo "=============================================== last ${TAILLOG} lines"
|
||||||
|
tail -n ${TAILLOG} ${TESTDB_DIR}/long.log
|
||||||
|
else
|
||||||
|
echo "=============================================== no test log"
|
||||||
|
fi
|
||||||
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$EXTRA" != "no" ]; then
|
if [ "$EXTRA" != "no" ]; then
|
||||||
@ -375,6 +404,9 @@ function bits2options {
|
|||||||
|
|
||||||
function failed {
|
function failed {
|
||||||
echo "FAILED" >&2
|
echo "FAILED" >&2
|
||||||
|
if [ ${TAILLOG} -gt 0 ]; then
|
||||||
|
taillog
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user