2022-12-17 16:04:13 +00:00
|
|
|
tap_total=0
|
|
|
|
|
2022-12-17 16:04:33 +00:00
|
|
|
tap_end()
|
2022-12-17 16:04:13 +00:00
|
|
|
{
|
2022-12-17 16:04:33 +00:00
|
|
|
printf "1..%d\n" $tap_total
|
2022-12-17 16:04:13 +00:00
|
|
|
}
|
|
|
|
|
2022-12-17 16:04:33 +00:00
|
|
|
tap_ok()
|
2022-12-17 16:04:13 +00:00
|
|
|
{
|
2022-12-17 16:04:33 +00:00
|
|
|
local msg="$@"
|
|
|
|
tap_total=$((tap_total + 1))
|
|
|
|
printf "ok %d - %s\n" $tap_total "$msg"
|
2022-12-17 16:04:13 +00:00
|
|
|
}
|
|
|
|
|
2022-12-17 16:04:33 +00:00
|
|
|
tap_fail()
|
2022-12-17 16:04:13 +00:00
|
|
|
{
|
2022-12-17 16:04:33 +00:00
|
|
|
local msg="$@"
|
|
|
|
tap_total=$((tap_total + 1))
|
|
|
|
printf "not ok %d - %s\n" $tap_total "$msg"
|
2022-12-17 16:04:13 +00:00
|
|
|
}
|
|
|
|
|
2022-12-17 16:04:33 +00:00
|
|
|
tap_skip()
|
2022-12-17 16:04:13 +00:00
|
|
|
{
|
2022-12-17 16:04:33 +00:00
|
|
|
local msg="$@"
|
|
|
|
tap_total=$((tap_total + 1))
|
|
|
|
[ -n "$msg" ] && msg=" $msg"
|
|
|
|
printf "ok %d - # skip%s\n" $tap_total "$msg"
|
2022-12-17 16:04:13 +00:00
|
|
|
}
|
|
|
|
|
2022-12-17 16:04:33 +00:00
|
|
|
tap_ensure()
|
2022-12-17 16:04:13 +00:00
|
|
|
{
|
2022-12-17 16:04:33 +00:00
|
|
|
local a="$1"
|
|
|
|
local b="$2"
|
|
|
|
local desc="$3"
|
|
|
|
[ "x$a" = "x$b" ] && tap_ok "$desc" || tap_fail "$desc"
|
2022-12-17 16:04:13 +00:00
|
|
|
}
|