Add skip command, rename tests/failures to tests/status
This commit is contained in:
parent
96f9c62d86
commit
3fca2f8d02
|
@ -10,7 +10,7 @@ build
|
|||
|
||||
message.fail
|
||||
|
||||
client/powerline
|
||||
/client/powerline
|
||||
|
||||
/tests/tmp
|
||||
/tests/failures
|
||||
/tests/status
|
||||
|
|
|
@ -13,7 +13,7 @@ if test -z "$FAILED" ; then
|
|||
FAIL_SUMMARY=""
|
||||
|
||||
TMP_ROOT="$ROOT/tests/tmp"
|
||||
export FAILURES_FILE="$ROOT/tests/failures"
|
||||
export FAILURES_FILE="$ROOT/tests/status"
|
||||
fi
|
||||
|
||||
ANSI_CLEAR="\033[0K"
|
||||
|
@ -56,15 +56,22 @@ fail() {
|
|||
local test_name="$1" ; shift
|
||||
local fail_char="$allow_failure$1" ; shift
|
||||
local message="$1" ; shift
|
||||
local verb="${1:-Failed}" ; shift
|
||||
local full_msg="$fail_char $POWERLINE_CURRENT_SUITE|$test_name :: $message"
|
||||
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
|
||||
echo "Failed: $full_msg"
|
||||
echo "$verb: $full_msg"
|
||||
echo "$full_msg" >> "$FAILURES_FILE"
|
||||
if test -z "$allow_failure" ; then
|
||||
FAILED=1
|
||||
fi
|
||||
}
|
||||
|
||||
skip() {
|
||||
local test_name="$1" ; shift
|
||||
local message="$1" ; shift
|
||||
fail --allow-failure "$test_name" S "$message" "Skipped"
|
||||
}
|
||||
|
||||
make_test_root() {
|
||||
local suffix="${POWERLINE_CURRENT_SUITE##*/}"
|
||||
|
||||
|
|
|
@ -33,10 +33,10 @@ for script in "$ROOT"/tests/test_*/test.sh ; do
|
|||
fi
|
||||
done
|
||||
|
||||
if test -e tests/failures ; then
|
||||
echo "Some tests failed. Summary:"
|
||||
cat tests/failures
|
||||
rm tests/failures
|
||||
if test -e "$FAILURES_FILE" ; then
|
||||
echo "Fails and skips summary:"
|
||||
cat "$FAILURES_FILE"
|
||||
rm "$FAILURES_FILE"
|
||||
fi
|
||||
|
||||
exit_suite
|
||||
|
|
Loading…
Reference in New Issue