mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
maint/util ~ improve/refactor 'build-gnu' & 'run-gnu-test'
- add more logging for better fault tracking - generalize for use in either RELEASE or DEBUG build mode (default to 'release') - improve variable naming precision/specificity
This commit is contained in:
parent
29679ba337
commit
c2e17e5f37
2 changed files with 69 additions and 39 deletions
|
@ -1,28 +1,30 @@
|
|||
#!/bin/bash
|
||||
# `$0 [TEST]`
|
||||
#!/bin/sh
|
||||
# `run-gnu-test.bash [TEST]`
|
||||
# run GNU test (or all tests if TEST is missing/null)
|
||||
# spell-checker:ignore (env/vars) GNULIB SUBDIRS ; (utils) shellcheck
|
||||
#
|
||||
# UU_MAKE_PROFILE == 'debug' | 'release' ## build profile used for *uutils* build; may be supplied by caller, defaults to 'debug'
|
||||
|
||||
# spell-checker:ignore (env/vars) GNULIB SRCDIR SUBDIRS ; (utils) shellcheck
|
||||
|
||||
ME_dir="$(dirname -- "$(readlink -fm -- "$0")")"
|
||||
REPO_main_dir="$(dirname -- "${ME_dir}")"
|
||||
|
||||
echo "ME_dir='${ME_dir}'"
|
||||
echo "REPO_main_dir='${REPO_main_dir}'"
|
||||
|
||||
set -e
|
||||
|
||||
### * config (from environment with fallback defaults)
|
||||
### * config (from environment with fallback defaults); note: GNU and GNULIB are expected to be sibling repo directories
|
||||
|
||||
path_UUTILS=${path_UUTILS:-${REPO_main_dir}}
|
||||
path_GNU=${path_GNU:-${path_UUTILS}/../gnu}
|
||||
path_GNULIB=${path_GNULIB:-${path_UUTILS}/../gnulib}
|
||||
path_GNU="$(readlink -fm -- "${path_GNU:-${path_UUTILS}/../gnu}")"
|
||||
|
||||
echo "path_UUTILS='${path_UUTILS}'"
|
||||
echo "path_GNU='${path_GNU}'"
|
||||
|
||||
###
|
||||
|
||||
BUILD_DIR="$(realpath -- "${path_UUTILS}/target/release")"
|
||||
GNULIB_DIR="$(realpath -- "${path_GNULIB}")"
|
||||
|
||||
export BUILD_DIR
|
||||
export GNULIB_DIR
|
||||
|
||||
pushd "$(realpath -- "${path_GNU}")"
|
||||
cd "${path_GNU}" && echo "[ pwd:'${PWD}' ]"
|
||||
|
||||
export RUST_BACKTRACE=1
|
||||
|
||||
|
@ -31,5 +33,8 @@ if test -n "$1"; then
|
|||
export RUN_TEST="TESTS=$1"
|
||||
fi
|
||||
|
||||
# * timeout used to kill occasionally errant/"stuck" processes (note: 'release' testing takes ~1 hour; 'debug' testing takes ~2.5 hours)
|
||||
# * `gl_public_submodule_commit=` disables testing for use of a "public" gnulib commit (which will fail when using shallow gnulib checkouts)
|
||||
# * `srcdir=..` specifies the GNU source directory for tests (fixing failing/confused 'tests/factor/tNN.sh' tests and causing no harm to other tests)
|
||||
#shellcheck disable=SC2086
|
||||
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
|
||||
timeout -sKILL 2h make -j "$(nproc)" check ${RUN_TEST} SUBDIRS=. RUN_EXPENSIVE_TESTS=yes RUN_VERY_EXPENSIVE_TESTS=yes VERBOSE=no gl_public_submodule_commit="" srcdir="${path_GNU}" || : # Kill after 4 hours in case something gets stuck in make
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue