Debian Codegraph @

testsuite/sanitytests/cloop.test

raw
1 #!/bin/sh
2
3 NP=4
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 np=1
20 stoptime=1.0
21 [A]
22 binary=${TEST_EXTRABINDIR}/contdelay
23 args=-d 0.1 -b 1000
24 [B]
25 binary=${TEST_EXTRABINDIR}/contdelay
26 args=-d 0.1 -b 1000
27 [from]
28 binary=${TEST_EXTRABINDIR}/clocksource
29 args=-b 5
30 [to]
31 binary=${TEST_BINDIR}/contsink
32
33 from.clock -> A.in [1,${method}]
34 A.out -> B.in [1,${method}]
35 B.out -> to.contdata [1,${method}]
36 B.out -> A.aux [1,${method}]
37 EOF
38
39 }
40
41 # this is the output we should expect to see
42 cat <<\EOF > "${MUSIC_DATA_PATH}/ok"
43 0 on 0 @0
44 0 on 0 @0.01
45 0 on 0 @0.02
46 0 on 0 @0.03
47 0 on 0 @0.04
48 0 on 0 @0.05
49 0 on 0 @0.06
50 0 on 0 @0.07
51 0 on 0 @0.08
52 0 on 0 @0.09
53 0 on 0 @0.1
54 0 on 0 @0.11
55 0 on 0 @0.12
56 0 on 0 @0.13
57 0 on 0 @0.14
58 0 on 0 @0.15
59 0 on 0 @0.16
60 0 on 0 @0.17
61 0 on 0 @0.18
62 0 on 0 @0.19
63 0 on 0 @0.2
64 0 on 0 @0.21
65 0 on 0 @0.22
66 0.01 on 0 @0.23
67 0.02 on 0 @0.24
68 0.03 on 0 @0.25
69 0.04 on 0 @0.26
70 0.05 on 0 @0.27
71 0.06 on 0 @0.28
72 0.07 on 0 @0.29
73 0.08 on 0 @0.3
74 0.09 on 0 @0.31
75 0.1 on 0 @0.32
76 0.11 on 0 @0.33
77 0.12 on 0 @0.34
78 0.13 on 0 @0.35
79 0.14 on 0 @0.36
80 0.15 on 0 @0.37
81 0.16 on 0 @0.38
82 0.17 on 0 @0.39
83 0.18 on 0 @0.4
84 0.19 on 0 @0.41
85 0.2 on 0 @0.42
86 0.21 on 0 @0.43
87 0.22 on 0 @0.44
88 0.24 on 0 @0.45
89 0.26 on 0 @0.46
90 0.28 on 0 @0.47
91 0.3 on 0 @0.48
92 0.32 on 0 @0.49
93 0.34 on 0 @0.5
94 0.36 on 0 @0.51
95 0.38 on 0 @0.52
96 0.4 on 0 @0.53
97 0.42 on 0 @0.54
98 0.44 on 0 @0.55
99 0.46 on 0 @0.56
100 0.48 on 0 @0.57
101 0.5 on 0 @0.58
102 0.52 on 0 @0.59
103 0.54 on 0 @0.6
104 0.56 on 0 @0.61
105 0.58 on 0 @0.62
106 0.6 on 0 @0.63
107 0.62 on 0 @0.64
108 0.64 on 0 @0.65
109 0.66 on 0 @0.66
110 0.69 on 0 @0.67
111 0.72 on 0 @0.68
112 0.75 on 0 @0.69
113 0.78 on 0 @0.7
114 0.81 on 0 @0.71
115 0.84 on 0 @0.72
116 0.87 on 0 @0.73
117 0.9 on 0 @0.74
118 0.93 on 0 @0.75
119 0.96 on 0 @0.76
120 0.99 on 0 @0.77
121 1.02 on 0 @0.78
122 1.05 on 0 @0.79
123 1.08 on 0 @0.8
124 1.11 on 0 @0.81
125 1.14 on 0 @0.82
126 1.17 on 0 @0.83
127 1.2 on 0 @0.84
128 1.23 on 0 @0.85
129 1.26 on 0 @0.86
130 1.29 on 0 @0.87
131 1.32 on 0 @0.88
132 1.36 on 0 @0.89
133 1.4 on 0 @0.9
134 1.44 on 0 @0.91
135 1.48 on 0 @0.92
136 1.52 on 0 @0.93
137 1.56 on 0 @0.94
138 1.6 on 0 @0.95
139 1.64 on 0 @0.96
140 1.68 on 0 @0.97
141 1.72 on 0 @0.98
142 1.76 on 0 @0.99
143 EOF
144 # sort the file using locale specified by current environment
145 sort "${MUSIC_DATA_PATH}/ok" -o "${MUSIC_DATA_PATH}/ok"
146
147 cat <<\EOF > "${MUSIC_DATA_PATH}/errok"
148 EOF
149
150 for method in point-to-point collective ; do
151 write_configuration "${method}"
152
153 run_test "${NP}" "${music_conf}"
154 exit_code=$?
155
156 if test "${exit_code}" -gt 0 ; then
157 exit "${exit_code}"
158 fi
159 done
160
161 exit 0
162
163