-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtests.sh
73 lines (67 loc) · 2.15 KB
/
runtests.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
69
70
71
72
73
#!/bin/sh
#
# This script runs all DMPACK test programs and prints the results to standard
# output. Simply run:
#
# $ sh runtests.sh
#
# You may want to uncomment and set the following environment variables.
#
# HTTP-RPC API host and credentials.
#
# export DM_API_HOST=localhost
# export DM_API_USERNAME=dummy-node
# export DM_API_PASSWORD=secret
#
# MQTT server settings:
#
# export DM_MQTT_HOST=localhost
# export DM_MQTT_PORT=1883
#
# E-mail and SMTP settings:
#
# export [email protected]
# export [email protected]
# export DM_MAIL_HOST=example.com
# export DM_MAIL_USERNAME=alice
# export DM_MAIL_PASSWORD=secret
#
# Skipping POSIX message queue tests:
#
# export DM_MQUEUE_SKIP=1
#
# Skipping pipe tests:
#
# export DM_PIPE_SKIP=1
#
TESTS="dmtestapi dmtestascii dmtestatom dmtestbase64 dmtestc dmtestcgi \
dmtestconfig dmtestcrypto dmtestcsv dmtestdb dmtestdp dmtestfile dmtesthash \
dmtesthdf5 dmtesthtml dmtestid dmtestjob dmtestjson dmtestlog dmtestlogger \
dmtestlua dmtestmail dmtestmodbus dmtestmqtt dmtestmqueue dmtestnml \
dmtestobserv dmtestpath dmtestpipe dmtestplot dmtestregex dmtestrpc dmtestrts \
dmteststring dmtestthread dmtesttime dmtesttty dmtestunit dmtestutil \
dmtestuuid dmtestversion dmtestz dmtestzlib dmtestzstd"
NTEST=`echo ${TESTS} | wc -w`
NFAIL=0
for TEST in ${TESTS}; do
./${TEST}
if [ $? -ne 0 ]; then
NFAIL=`expr ${NFAIL} + 1`
printf "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
printf "TEST %s FAILED!\n" ${TEST}
printf "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
fi
done
printf "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
if [ ${NFAIL} -eq 0 ]; then
printf "ALL %s TEST PROGRAMS FINISHED SUCCESSFULLY!\n" ${NTEST}
else
printf "%s OF %s TEST PROGRAMS FAILED!\n" ${NFAIL} ${NTEST}
fi
printf "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n"
printf "User and system times used by this script:\n"
times
printf "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\n"
if [ ${NFAIL} -gt 0 ]; then
exit 1
fi