Files
mgmt/test/util.sh
James Shubin cffdb06181 test, docs: Add a linter for testing markdown, and fix up our docs
While writing docs, I couldn't remember what the correct style was
supposed to be, and I remember someone complaining about this
previously, so I decided to add a linter! I excluded a bunch of annoying
style rules, but if we find more we can add those to the list too.

Hopefully this gives us a more consistent feel throughout.
2018-02-21 22:52:41 -05:00

29 lines
575 B
Bash
Executable File

#!/bin/bash
# common settings and functions for test scripts
# get the fully expanded path of the project directory
ROOT="$(realpath "$(dirname "$(realpath "${BASH_SOURCE}")")/..")"
# absolute location to freshly build binary to be used for testing
export MGMT="$ROOT/mgmt"
if [[ $(uname) == "Darwin" ]] ; then
export timeout="gtimeout"
export mktemp="gmktemp"
else
export timeout="timeout"
export mktemp="mktemp"
fi
fail_test()
{
echo -e "FAIL: $@"
exit 1
}
function run-test()
{
"$@" || failures=$( [ -n "$failures" ] && echo "$failures\\n$@" || echo "$@" )
}