-
Notifications
You must be signed in to change notification settings - Fork 1
/
gcov.sh
executable file
·69 lines (52 loc) · 1.15 KB
/
gcov.sh
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
60
61
62
63
64
65
66
67
68
#!/bin/bash
LOG=em100_test.log
i=0
banner_test()
{
printf "\rRunning tests... %03d" $i
}
next_test()
{
lcov --no-external --capture --directory . -t TEST_$i --output-file coverage.info >> $LOG
i=$(( $i + 1))
}
printf "Building... "
echo "Test log" > $LOG
make clean >> $LOG
CFLAGS="-O2 -g -fomit-frame-pointer -fprofile-arcs -ftest-coverage" make >> $LOG
printf "ok\n";
banner_test
# some prep work
export EM100_HOME=$(mktemp -d)
i=$(( $i + 1))
banner_test
./em100 >>$LOG 2>&1
next_test
banner_test
./em100 --help >> $LOG 2>&1
next_test
banner_test
./em100 -U >> $LOG 2>&1
next_test
banner_test
./em100 --stop --set M25P80 -d file.bin -v --start >> $LOG 2>&1
next_test
banner_test
./em100 -U file.bin >> $LOG 2>&1
next_test
banner_test
./em100 --list-devices >> $LOG 2>&1
next_test
banner_test
./em100 --firmware-dump $EM100_HOME/test1.raw >> $LOG 2>&1
next_test
banner_test
./em100 --firmware-write $EM100_HOME/test2.dpfw >> $LOG 2>&1
next_test
banner_test
./em100 --firmware-update auto >> $LOG 2>&1
next_test
printf "\n\n"
printf "Now power cycle your EM100Pro\n"
genhtml coverage.info --output-directory out >> $LOG
rm *.gcno *.gcda xz/*.gcno xz/*.gcda