half-way implementation of error on no found tests
This commit is contained in:
parent
918bf31ec5
commit
f2305648b7
3
tests/Errors/1 when no tests are found/exit code
Executable file
3
tests/Errors/1 when no tests are found/exit code
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
../../../urchin $testdir
|
||||
test 1 -eq $?
|
4
tests/Errors/1 when no tests are found/setup
Normal file
4
tests/Errors/1 when no tests are found/setup
Normal file
@ -0,0 +1,4 @@
|
||||
tmp=$(mktemp -d)
|
||||
export testdir=$tmp/tests
|
||||
mkdir -p $testdir
|
||||
touch $testdir/.urchin
|
2
tests/Errors/1 when no tests are found/stderr
Executable file
2
tests/Errors/1 when no tests are found/stderr
Executable file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
../../../urchin $testdir 2>&1 | grep -i 'no.*found'
|
1
tests/Errors/1 when no tests are found/teardown
Normal file
1
tests/Errors/1 when no tests are found/teardown
Normal file
@ -0,0 +1 @@
|
||||
rm -R $tmp
|
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
tmp=$(mktemp -d)
|
||||
testdir=$tmp/tests
|
||||
mkdir -p $testdir
|
||||
|
||||
set +e
|
||||
../../urchin -n -t $testdir
|
||||
e=$?
|
||||
set -e
|
||||
|
||||
rm -R $tmp
|
||||
exit $e
|
11
urchin
11
urchin
@ -56,10 +56,6 @@ if [ -n "${ZSH_VERSION}" ]; then
|
||||
fi
|
||||
|
||||
|
||||
# Make sure that CDPATH isn't set, as it causes `cd` to behave unpredictably -
|
||||
# notably, it can produce output.
|
||||
unset CDPATH
|
||||
|
||||
# All temporary files go here
|
||||
urchin_tmp=$(mktemp -d)
|
||||
> "${urchin_tmp}/log"
|
||||
@ -146,7 +142,7 @@ recurse() {
|
||||
|
||||
if [ -d "${potential_test}" ]; then
|
||||
(
|
||||
cd -- "${potential_test}" > /dev/null
|
||||
cd -- "${potential_test}"
|
||||
if test -f setup_dir; then . ./setup_dir; fi
|
||||
|
||||
for test in *; do
|
||||
@ -568,6 +564,11 @@ main() {
|
||||
recurse "$(fullpath "${1}")" "${root}" "${cycle_shell}" "${TEST_SHELL}" || :
|
||||
finish=$(date +%s)
|
||||
|
||||
test $(cat "${urchin_tmp}"/log | wc -l) -gt 0 || {
|
||||
echo 'No tests found' > /dev/stderr
|
||||
urchin_exit 1
|
||||
}
|
||||
|
||||
report_outcome "${root}" "${tap_format}" "${urchin_tmp}"/log "${start}" \
|
||||
"${finish}"
|
||||
urchin_exit "${?}"
|
||||
|
Loading…
Reference in New Issue
Block a user