blob: ff3656deb5f9dd97caf74b96f4b1f78d6d085281 [file] [log] [blame]
Stefan Reinauer5f3260d2019-12-04 20:04:03 -08001#!/bin/bash
2
3LOG=em100_test.log
4
5i=0
6banner_test()
7{
8 printf "\rRunning tests... %03d" $i
9}
10
11next_test()
12{
13 lcov --no-external --capture --directory . -t TEST_$i --output-file coverage.info >> $LOG
14 i=$(( $i + 1))
15}
16
17printf "Building... "
18echo "Test log" > $LOG
19make clean >> $LOG
20CFLAGS="-O2 -g -fomit-frame-pointer -fprofile-arcs -ftest-coverage" make >> $LOG
21printf "ok\n";
22
23banner_test
24# some prep work
25export EM100_HOME=$(mktemp -d)
26i=$(( $i + 1))
27
28banner_test
29./em100 >>$LOG 2>&1
30next_test
31
32banner_test
33./em100 --help >> $LOG 2>&1
34next_test
35
36banner_test
37./em100 -U >> $LOG 2>&1
38next_test
39
40banner_test
41./em100 --stop --set M25P80 -d file.bin -v --start >> $LOG 2>&1
42next_test
43
44banner_test
45./em100 -U file.bin >> $LOG 2>&1
46next_test
47
48banner_test
49./em100 --list-devices >> $LOG 2>&1
50next_test
51
52banner_test
53./em100 --firmware-dump $EM100_HOME/test1.raw >> $LOG 2>&1
54next_test
55
56banner_test
57./em100 --firmware-write $EM100_HOME/test2.dpfw >> $LOG 2>&1
58next_test
59
60banner_test
61./em100 --firmware-update auto >> $LOG 2>&1
62next_test
63
64printf "\n\n"
65printf "Now power cycle your EM100Pro\n"
66
67genhtml coverage.info --output-directory out >> $LOG
68rm *.gcno *.gcda xz/*.gcno xz/*.gcda
69