2021-05-21 16:25:23 +00:00
#!/bin/bash
2022-02-03 19:42:13 +00:00
# `$0 [TEST]`
# run GNU test (or all tests if TEST is missing/null)
2022-02-06 23:05:12 +00:00
# spell-checker:ignore (env/vars) GNULIB SUBDIRS ; (utils) shellcheck
2022-02-03 19:42:13 +00:00
ME_dir = " $( dirname -- " $( readlink -fm -- " $0 " ) " ) "
REPO_main_dir = " $( dirname -- " ${ ME_dir } " ) "
2021-05-21 16:25:23 +00:00
set -e
2022-02-03 19:42:13 +00:00
### * config (from environment with fallback defaults)
path_UUTILS = ${ path_UUTILS :- ${ REPO_main_dir } }
path_GNU = ${ path_GNU :- ${ path_UUTILS } /../gnu }
path_GNULIB = ${ path_GNULIB :- ${ path_UUTILS } /../gnulib }
###
BUILD_DIR = " $( realpath -- " ${ path_UUTILS } /target/release " ) "
GNULIB_DIR = " $( realpath -- " ${ path_GNULIB } " ) "
export BUILD_DIR
export GNULIB_DIR
pushd " $( realpath -- " ${ path_GNU } " ) "
2021-05-21 16:25:23 +00:00
2021-06-02 18:59:53 +00:00
export RUST_BACKTRACE = 1
2021-06-02 19:21:12 +00:00
if test -n " $1 " ; then
# if set, run only the test passed
export RUN_TEST = " TESTS= $1 "
fi
2022-02-01 06:55:11 +00:00
#shellcheck disable=SC2086
2021-06-02 19:21:12 +00:00
timeout -sKILL 2h make -j " $( nproc) " check $RUN_TEST SUBDIRS = . RUN_EXPENSIVE_TESTS = yes RUN_VERY_EXPENSIVE_TESTS = yes VERBOSE = no || : # Kill after 4 hours in case something gets stuck in make