Skip to content

Commit 56dffdd

Browse files
codypssofar
authored andcommitted
add basic, non-reproducable, run test
1 parent f759996 commit 56dffdd

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ systemd_bootchart_LDADD = \
192192

193193
#####################################################
194194

195+
TESTS = tests/run
196+
195197
substitutions = \
196198
'|rootlibexecdir=$(rootlibexecdir)|'
197199

tests/run

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /bin/sh
2+
d=
3+
cleanup() {
4+
if [ -n "$d" ]; then
5+
d=
6+
rm -rf "$d"
7+
fi
8+
}
9+
trap cleanup EXIT
10+
d=`mktemp -d`
11+
12+
test_runs=0
13+
test_failures=0
14+
15+
t() {
16+
"$@"
17+
local r=$?
18+
: $((test_runs=test_runs+1))
19+
if [ $r -ne 0 ]; then
20+
: $((test_failures=test_failures+1))
21+
echo "not ok $test_runs - $*"
22+
fi
23+
}
24+
25+
echo 1..3
26+
t ./systemd-bootchart -o "$d" -n 2 -r
27+
t ./systemd-bootchart -o "$d" -n 10 -r
28+
t ./systemd-bootchart -o "$d" -n 10 -r -p
29+
30+
if [ $test_failures -ne 0 ]; then
31+
echo "# Failed $test_failures out of $test_runs tests"
32+
exit 1
33+
fi

0 commit comments

Comments
 (0)