forked from nasa/fpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
executable file
·59 lines (49 loc) · 820 Bytes
/
run
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
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
. ../../../scripts/test-utils.sh
fpp_format=../../../bin/fpp-format
fpp_syntax=../../../bin/fpp-syntax
compare()
{
outfile=$1
diff -u $outfile.ref.txt $outfile.out.txt > $outfile.diff.txt 2>&1
}
run_test()
{
args=$1
infile=$2
if test -n "$3"
then
outfile=$3
else
outfile=$infile
fi
$fpp_format $args $infile.fpp 2>&1 | remove_path_prefix > $outfile.out.txt
compare $outfile
}
. ./tests.sh
# Default tests
for t in $tests
do
echo "
$t()
{
run_test '' $t
}"
done > default-tests.sh
. ./default-tests.sh
include()
{
run_test '-i' syntax include && \
$fpp_syntax include.out.txt
}
kwd_names()
{
run_test '' kwd_names && \
$fpp_syntax kwd_names.out.txt
}
no_include()
{
run_test '' syntax no_include && \
$fpp_syntax no_include.out.txt
}
run_suite $tests