Debian Codegraph @

testsuite/sanitytests/contclock.test

raw
1 #!/bin/sh
2
3 NP=2
4 music_conf="$( echo "${0##*/}" | sed 's/\.test//' ).music"
5
6 abspath="$(cd "${0%/*}" 2>/dev/null; echo "$PWD"/"${0##*/}")"
7 path="`dirname $abspath`"
8
9 . ${path}/run_test
10
11 write_configuration ()
12 {
13
14 method=$1
15 echo "Communication method: ${method}"
16
17 # this is music configuration file
18 cat <<EOF > "${MUSIC_DATA_PATH}/${music_conf}"
19 stoptime=0.5
20 [from]
21 np=1
22 binary=${TEST_EXTRABINDIR}/clocksource
23 args=-t 0.02 -b 3
24 [to]
25 np=1
26 binary=${TEST_BINDIR}/contsink
27 args=-t 0.03
28 from.clock -> to.contdata [1, ${method}]
29 EOF
30
31 }
32
33 # this is the output we should expect to see
34 cat <<\EOF > "${MUSIC_DATA_PATH}/ok"
35 0 on 0 @0
36 0.03 on 0 @0.03
37 0.06 on 0 @0.06
38 0.09 on 0 @0.09
39 0.12 on 0 @0.12
40 0.15 on 0 @0.15
41 0.18 on 0 @0.18
42 0.21 on 0 @0.21
43 0.24 on 0 @0.24
44 0.27 on 0 @0.27
45 0.3 on 0 @0.3
46 0.33 on 0 @0.33
47 0.36 on 0 @0.36
48 0.39 on 0 @0.39
49 0.42 on 0 @0.42
50 0.45 on 0 @0.45
51 0.48 on 0 @0.48
52 EOF
53 # sort the file using locale specified by current environment
54 sort "${MUSIC_DATA_PATH}/ok" -o "${MUSIC_DATA_PATH}/ok"
55
56 cat <<\EOF > "${MUSIC_DATA_PATH}/errok"
57 EOF
58
59 for method in point-to-point collective ; do
60 write_configuration "${method}"
61
62 run_test "${NP}" "${music_conf}"
63 exit_code=$?
64
65 if test "${exit_code}" -gt 0 ; then
66 exit "${exit_code}"
67 fi
68 done
69
70 exit 0
71
72