Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lint_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Lint requirements
ruff~=0.15.0
ruff~=0.15.1
mypy~=1.19.1
shellcheck-py~=0.11.0.1

Expand Down
24 changes: 24 additions & 0 deletions tests/scripts/config.source
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,28 @@ expect_deny () {
fi
}

# Expects the provided test to pass
# Supresses all output, which is redirected to ASSERTION_OUTPUT and
# ASSERTION_ERROUTPUT so as not to overwrite the latest OUTPUT and ERROUTPUT.
# That way we can test several assertions in a row.
# Reports verbosely on failure.
assert () {
if {
[[ "$@" ]]
} 1>log.out 2>log.err
then
echo "SUCCESS [$@]" >&3
ASSERTION_OUTPUT="$(cat log.out)"
ASSERTION_ERROUTPUT="$(cat log.err)"
else
echo "FAILURE [$@]" >&3
echo "=== STDOUT ===" >&3
cat log.out >&3
echo "=== STDERR ===" >&3
cat log.err >&3
echo "==============" >&3
false
fi
}

set -eu
Loading