-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest
More file actions
executable file
·49 lines (46 loc) · 1.09 KB
/
test
File metadata and controls
executable file
·49 lines (46 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
result=0
if [ -z "$*" ]
then dirs="extra-scripts simple-example extra-ordering no-scripts extra-startup extra-files skip-optional managed-scripts managed-scripts-override"
else dirs="$@"
fi
for subdir in $dirs
do (
cd $subdir
printf "testing examples in $subdir:\n"
./startup >actual.stdout 2>actual.stderr
RESULT="PASS"
if [ ! -f expected.stdout -a ! -f expected.stderr ]
then
RESULT="FAIL: No expected files were found"
else
if [ -f expected.stdout ]
then
if ! cmp actual.stdout expected.stdout
then
RESULT="FAIL"
printf "=== ACTUAL STDOUT ===\n"
cat actual.stdout
printf "=== EXPECTED STDOUT ===\n"
cat expected.stdout
fi
fi
if [ -f expected.stderr ]
then
if ! cmp actual.stderr expected.stderr
then
RESULT="FAIL"
printf "=== ACTUAL STDERR ===\n"
cat actual.stderr
printf "=== EXPECTED STDERR ===\n"
cat expected.stderr
fi
fi
fi
if [ "${RESULT}" = "PASS" ]
then printf ">> PASS\n"
else printf ">> FAIL\n"
fi
)
done
exit $result