Commit | Line | Data |
---|---|---|
fce9a534 SM |
1 | # |
2 | # This file is meant to be sourced from other tests scripts. | |
3 | # | |
4 | ||
748f9af1 MJ |
5 | cleanup() { |
6 | if [ x"$TMPFILE" != "x" ]; then | |
7 | rm -f "$TMPFILE" | |
8 | fi | |
fce9a534 | 9 | |
748f9af1 MJ |
10 | # Call the tap.sh exit cleanup code |
11 | _exit | |
f80aadcd MJ |
12 | } |
13 | ||
748f9af1 | 14 | xseq() { |
f80aadcd MJ |
15 | i=$1 |
16 | while [[ "$i" -le "$2" ]]; do | |
17 | echo "$i" | |
748f9af1 | 18 | i=$(( i + 1 )) |
f80aadcd MJ |
19 | done |
20 | } | |
748f9af1 MJ |
21 | |
22 | # Set TEST_TIME_BIN | |
23 | if [ -x "$URCU_TEST_TIME_BIN" ]; then | |
24 | TEST_TIME_BIN="$URCU_TEST_TIME_BIN" | |
25 | elif [ -x "/usr/bin/time" ]; then | |
26 | TEST_TIME_BIN="/usr/bin/time" | |
27 | else | |
28 | TEST_TIME_BIN="" | |
29 | fi | |
30 | export TEST_TIME_BIN | |
31 | ||
32 | # Create a temporary file for tests output | |
33 | TMPFILE=$(mktemp) | |
34 | ||
35 | # Set traps to delete the temporary file on exit | |
36 | trap cleanup EXIT |