1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 06:21:14 +02:00

Merge pull request #10650 from fricklerhandwerk/simplify-shell-tests

tests: remove unneeded indirection
This commit is contained in:
John Ericson 2024-05-06 10:24:45 -04:00 committed by GitHub
commit ea70878a76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 12 deletions

View file

@ -17,11 +17,3 @@ TESTS_ENVIRONMENT=(
run () { run () {
cd "$(dirname $1)" && env "${TESTS_ENVIRONMENT[@]}" $BASH -x -e -u -o pipefail $(basename $1) cd "$(dirname $1)" && env "${TESTS_ENVIRONMENT[@]}" $BASH -x -e -u -o pipefail $(basename $1)
} }
init_test () {
run "$init" 2>/dev/null > /dev/null
}
run_test_proper () {
run "$test"
}

View file

@ -9,6 +9,6 @@ dir="$(dirname "${BASH_SOURCE[0]}")"
source "$dir/common-test.sh" source "$dir/common-test.sh"
if [ -n "$init" ]; then if [ -n "$init" ]; then
(init_test) (run "$init" 2>/dev/null > /dev/null)
fi fi
run_test_proper run "$test"

View file

@ -23,9 +23,9 @@ fi
run_test () { run_test () {
if [ -n "$init" ]; then if [ -n "$init" ]; then
(init_test 2>/dev/null > /dev/null) (run "$init" 2>/dev/null > /dev/null)
fi fi
log="$(run_test_proper 2>&1)" && status=0 || status=$? log="$(run "$test" 2>&1)" && status=0 || status=$?
} }
run_test run_test