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