-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest_all.sh
More file actions
executable file
·78 lines (67 loc) · 1.6 KB
/
test_all.sh
File metadata and controls
executable file
·78 lines (67 loc) · 1.6 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
RED_C='\033[91;1m'
GREEN_C='\033[92;1m'
END_C='\033[0m'
# Work in process:
# axconfig/rt_axconfig
# task/rt_task
# axtrap/rt_axtrap
# axmount/test_axmount
TESTCASES="
early_console/rt_early_console
axlog2/rt_axlog2
axhal/rt_axhal
user_stack/rt_user_stack
driver_block/rt_driver_block
driver_virtio/rt_driver_virtio
axmount/rt_axmount
mutex/rt_mutex
axalloc/rt_axalloc
page_table/rt_page_table
mm/rt_mm
fstree/rt_fstree
mmap/rt_mmap
run_queue/rt_run_queue
fileops/rt_fileops
fork/rt_fork
axfs_ramfs/rt_ramfs
axdtb/rt_axdtb
bprm_loader/rt_bprm_loader
exec/rt_exec
macrokernel/rt_macrokernel
"
PASSED=0
FAILED=0
FAILURES=
for TEST in $TESTCASES
do
printf "\n[$TEST]: ...\n\n"
set -e
make A=$TEST prepare
make A=$TEST I=/btp/sbin/hello DUMP_OUTPUT=y run
set +e
ret_str=$(cat ${TEST}/expect_output 2>/dev/null)
if [ -z "${ret_str}" ]; then
ret_str="\[\S*\]: ok!"
fi
#echo "***** ${ret_str}"
grep -q "${ret_str}" /tmp/output.log
if [ $? -eq 0 ]; then
printf "\n[$TEST]: ${GREEN_C}PASSED!${END_C}\n\n"
PASSED=$(( PASSED + 1 ))
else
printf "\n[$TEST]: ${RED_C}FAILED!${END_C}\n\n"
FAILED=$(( FAILED + 1 ))
FAILURES="\n${TEST}${FAILURES}"
fi
done
TOTAL=$(( PASSED + FAILED ))
printf "Summary for tests:\n"
printf "================\n"
printf " Passed: ${PASSED}\n"
printf " Failed: ${FAILED}\n"
printf " Total : ${TOTAL}\n"
printf "================\n"
if [ -n "${FAILURES}" ]; then
printf "\nFailed tests:${FAILURES}\n" && false
fi