Skip to content
Open
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ TODO RUNS false
# you can mark known test cases as SKIP when then
# are known not to run under some condition
SKIP test $(uname -s) == Darwin # Tests dont run under Darwin
```

#### Running Skip Tests

Expand Down
15 changes: 14 additions & 1 deletion osht.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
: ${OSHT_STDIO=$($OSHT_MKTEMP)}
: ${OSHT_VERBOSE=}
: ${OSHT_WATCH=}
: ${OSHT_OVERRIDE_TRAP=}

: ${_OSHT_CURRENT_TEST_FILE=$($OSHT_MKTEMP)}
: ${_OSHT_CURRENT_TEST=0}
Expand Down Expand Up @@ -100,7 +101,19 @@ function _osht_cleanup {
exit $rv
}

trap _osht_cleanup INT TERM EXIT
appendTrap() {
HANDLER=$1
shift
SIGNALS="$*"
eval "set -- $(trap -p ${SIGNALS})"
trap -- "${3}${3:+;}${HANDLER}" ${SIGNALS}
}

if [ -n "$OSHT_OVERRIDE_TRAP" ]; then
trap _osht_cleanup INT TERM EXIT
else
appendTrap _osht_cleanup INT TERM EXIT
fi

function _osht_xmlencode {
sed -e 's/\&/\&amp;/g' -e 's/\"/\&quot;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g'
Expand Down