]> git.pld-linux.org Git - projects/geninitrd.git/blob - tests/setup-test.sh
no need to mess with magic values, let the "magic" be value
[projects/geninitrd.git] / tests / setup-test.sh
1 #!/bin/sh
2
3 # this should be overriden by test
4 runtest_run() {
5         :
6 }
7
8 fail=0 ok=0
9 fail() {
10         echo "FAIL: $@"
11         fail=$((fail+1))
12         return 1
13 }
14 ok() {
15         echo "OK: $@"
16         ok=$((ok+1))
17         return 0
18 }
19 runtest() {
20         local exp=$(mktemp) out=$(mktemp)
21         cat > $exp
22         eval $@
23         runtest_run > $out
24         diff -u $out $exp || fail "$@" && ok "$@\n$(cat $exp)"
25         rm -f $exp $out
26 }
27
28 # here should be tests
This page took 0.033333 seconds and 3 git commands to generate.