Changeset 14176
- Timestamp:
- Jul 12, 2007, 2:26:24 PM (19 years ago)
- Location:
- trunk/Ohana/src/opihi
- Files:
-
- 13 added
- 10 edited
-
cmd.basic/test/for.sh (modified) (10 diffs)
-
cmd.basic/test/if.sh (modified) (1 diff)
-
cmd.basic/test/list.sh (modified) (3 diffs)
-
cmd.basic/test/local.sh (added)
-
cmd.basic/test/output.sh (added)
-
cmd.basic/test/scan.sh (modified) (4 diffs)
-
cmd.basic/test/sleep.sh (modified) (1 diff)
-
cmd.basic/test/strlen.sh (modified) (2 diffs)
-
cmd.basic/test/strpop.sh (added)
-
cmd.basic/test/substr.sh (added)
-
cmd.basic/test/usleep.sh (added)
-
cmd.basic/test/while.sh (modified) (1 diff)
-
cmd.data/test/applyfit.sh (added)
-
cmd.data/test/concat.sh (added)
-
cmd.data/test/create.sh (added)
-
cmd.data/test/cumulative.sh (added)
-
cmd.data/test/delete.sh (added)
-
cmd.data/test/fit2d.sh (added)
-
cmd.data/test/integrate.sh (added)
-
cmd.data/test/interpolate.sh (added)
-
cmd.data/test/peak.sh (modified) (2 diffs)
-
cmd.data/test/periodogram.sh (modified) (2 diffs)
-
cmd.data/test/queues.sh (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/test/for.sh
r10647 r14176 8 8 memtest1 9 9 memtest2 10 memtest2a11 10 memtest3 12 11 end … … 15 14 macro test1 16 15 16 $PASS = 0 17 17 18 local i 18 19 … … 31 32 macro test2 32 33 34 $PASS = 0 35 33 36 local i 34 37 … … 47 50 # do we loop up in small steps correctly? 48 51 macro test3 52 53 $PASS = 0 49 54 50 55 local i N … … 68 73 macro test4 69 74 75 $PASS = 0 76 70 77 local i N 71 78 … … 87 94 # do we break from a loop correctly 88 95 macro test5 96 97 $PASS = 0 89 98 90 99 break -auto off … … 112 121 macro memtest1 113 122 123 $PASS = 0 124 114 125 local i N 115 126 … … 136 147 macro memtest2 137 148 149 $PASS = 0 150 138 151 local i N 139 152 … … 163 176 end 164 177 165 # check memleaks with many loop lines166 macro memtest2a167 168 local i N169 170 list word -x "ps -p $PID -o rss"171 $startmem = $word:1172 173 output /dev/null174 for i 0 10000175 echo "test line in loop"176 echo "test line in loop"177 end178 output stdout179 180 list word -x "ps -p $PID -o rss"181 $endmem = $word:1182 183 $PASS = 1184 185 if ($endmem - $startmem > 10)186 $PASS = 0187 echo "growth: {$endmem-$startmem}"188 echo "kB/loop: {($endmem-$startmem)/10000}"189 end190 end191 192 # check memleaks with many loop lines193 macro memtest2b194 195 local i N196 197 list word -x "ps -p $PID -o rss"198 $startmem = $word:1199 200 output /dev/null201 for i 0 1000202 exec echo "test line in loop" > /dev/null203 exec echo "test line in loop" > /dev/null204 end205 output stdout206 207 list word -x "ps -p $PID -o rss"208 $endmem = $word:1209 210 $PASS = 1211 212 if ($endmem - $startmem > 10)213 $PASS = 0214 echo "growth: {$endmem-$startmem}"215 echo "kB/loop: {($endmem-$startmem)/1000}"216 end217 end218 219 178 # check memleaks on break 220 179 macro memtest3 180 181 $PASS = 0 221 182 222 183 local i N … … 254 215 end 255 216 end 256 -
trunk/Ohana/src/opihi/cmd.basic/test/if.sh
r10311 r14176 14 14 test12 15 15 test13 16 test1416 # test14 17 17 end 18 18 -
trunk/Ohana/src/opihi/cmd.basic/test/list.sh
r10311 r14176 92 92 $startmem = $word:1 93 93 94 for i 0 1000 094 for i 0 1000 95 95 list check2 -split This is a list 96 end97 98 list word -x "ps -p $PID -o rss"99 $endmem = $word:1100 101 $PASS = 1102 103 if ($endmem - $startmem > 10)104 $PASS = 0105 echo "growth: {$endmem-$startmem}"106 echo "kB/loop: {($endmem-$startmem)/10000}"107 end108 109 end110 111 # Memory test for list -x112 macro memtest3113 114 local i115 116 list word -x "ps -p $PID -o rss"117 $startmem = $word:1118 119 for i 0 100120 list check3 -x "ls /etc"121 96 end 122 97 … … 135 110 136 111 # Memory test for list -x 137 # XXX these need to be cleaned up to use the actual 138 # size of the list to calculate leakage... 112 macro memtest3 113 114 local i 115 116 list word -x "ps -p $PID -o rss" 117 $startmem = $word:1 118 119 for i 0 1000 120 list check3 -x "ls /dev/null" 121 end 122 123 list word -x "ps -p $PID -o rss" 124 $endmem = $word:1 125 126 $PASS = 1 127 128 if ($endmem - $startmem > 10) 129 $PASS = 0 130 echo "growth: {$endmem-$startmem}" 131 echo "kB/loop: {($endmem-$startmem)/1000}" 132 end 133 134 end 135 136 # Memory test for list -x 139 137 macro memtest4 140 138 … … 155 153 $startmem = $word:1 156 154 157 for i 0 100 155 for i 0 1000 158 156 list check4 -x "cat list_test.txt" 159 157 end -
trunk/Ohana/src/opihi/cmd.basic/test/scan.sh
r10311 r14176 54 54 $startmem = $word:1 55 55 56 for i 0 1000 056 for i 0 1000 57 57 scan test_file.txt fscan 58 58 end … … 66 66 $PASS = 0 67 67 echo "growth: {$endmem-$startmem}" 68 echo "kB/loop: {($endmem-$startmem)/1000 0}"68 echo "kB/loop: {($endmem-$startmem)/1000}" 69 69 end 70 70 … … 96 96 $startmem = $word:1 97 97 98 for i 0 1000 098 for i 0 1000 99 99 scan test_file.txt fscan 5 100 100 end … … 108 108 $PASS = 0 109 109 echo "growth: {$endmem-$startmem}" 110 echo "kB/loop: {($endmem-$startmem)/1000 0}"110 echo "kB/loop: {($endmem-$startmem)/1000}" 111 111 end 112 112 -
trunk/Ohana/src/opihi/cmd.basic/test/sleep.sh
r10311 r14176 9 9 list tstart -x "date +%S" 10 10 11 sleep 1011 sleep 3 12 12 13 13 list tend -x "date +%S" 14 14 15 if ($tstart:0 >= 5 0)15 if ($tstart:0 >= 57) 16 16 $tend:0 = $tend:0 + 60 17 17 end 18 18 19 $diff = abs ( 10- abs($tstart:0 - $tend:0))19 $diff = abs (3 - abs($tstart:0 - $tend:0)) 20 20 21 21 if ($diff > 1.1) -
trunk/Ohana/src/opihi/cmd.basic/test/strlen.sh
r10311 r14176 30 30 $startmem = $word:1 31 31 32 for i 0 1000 032 for i 0 1000 33 33 strlen $tstr len 34 34 end … … 42 42 $PASS = 0 43 43 echo "growth: {$endmem-$startmem}" 44 echo "kB/loop: {($endmem-$startmem)/1000 0}"44 echo "kB/loop: {($endmem-$startmem)/1000}" 45 45 end 46 46 -
trunk/Ohana/src/opihi/cmd.basic/test/while.sh
r10311 r14176 12 12 $PASS = 0 13 13 echo "While loop failure!" 14 echo "i: $i" 14 15 break 15 16 end -
trunk/Ohana/src/opihi/cmd.data/test/peak.sh
r9197 r14176 4 4 test2 5 5 test3 6 test4 7 test5 6 testmem1 8 7 end 9 8 … … 77 76 78 77 # test memory usage 79 macro test4 80 $PASS = 1 78 macro testmem1 81 79 break -auto off 82 80 83 create x 0 100 81 create x 0 1000 84 82 set y = zero (x) 85 y[60] = 2 86 y[50] = 1 87 y[40] = 2 83 y[500] = 100 88 84 89 echo "peak:" 90 exec ps aux | grep mana | grep -v grep 91 for i 0 100000 92 peak -q x y 45 55 85 list word -x "ps -p $PID -o rss" 86 $startmem = $word:1 87 88 for i 0 10000 89 peak -q x y 400 600 93 90 end 94 exec ps aux | grep mana | grep -v grep 91 92 list word -x "ps -p $PID -o rss" 93 $endmem = $word:1 95 94 96 ## HOW do we test this? 95 if ({$endmem - $startmem} < 10) 96 $PASS = 1 97 else 98 $PASS = 0 99 echo "growth: {$endmem-$startmem}" 100 echo "kB/loop: {($endmem-$startmem)/10000}" 101 end 102 97 103 end 98 99 # test memory usage100 macro test5101 $PASS = 1102 break -auto off103 104 create x 0 100105 set y = zero (x)106 y[60] = 2107 y[50] = 1108 y[40] = 2109 110 echo "peak:"111 exec ps aux | grep mana | grep -v grep112 for i 0 1000113 peak x y 45 55114 end115 exec ps aux | grep mana | grep -v grep116 117 ## HOW do we test this?118 end119 -
trunk/Ohana/src/opihi/cmd.data/test/periodogram.sh
r6642 r14176 23 23 if (abs ($peakpos - $P) > 0.5) 24 24 $PASS = 0 25 echo "OFFSET: {$peakpos - $P}" 25 26 end 26 27 end … … 90 91 periodogram t f 2 30 period power 91 92 92 lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f93 lim -n 1 period power; clear; box; plot period power93 # lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f 94 # lim -n 1 period power; clear; box; plot period power 94 95 95 96 peak -q period power -
trunk/Ohana/src/opihi/cmd.data/test/queues.sh
r9359 r14176 21 21 # test queueinit 22 22 macro test1 23 23 $PASS = 1 24 24 queueinit dummy 25 25 queuesize dummy -var N … … 30 30 end 31 31 32 # test queueinit 32 # test queueinit memory 33 33 macro testmem1 34 34 $PASS = 1 35 35 list word -x "ps -p $PID -o rss" 36 36 $startmem = $word:1 … … 54 54 # test queuesize 55 55 macro test2 56 56 $PASS = 1 57 57 queueinit dummy 58 58 queuepush dummy foobar … … 64 64 end 65 65 66 # test queuesize 66 # test queuesize memory 67 67 macro testmem2 68 68 $PASS = 1 69 69 queueinit dummy 70 70 queuepush dummy foobar … … 91 91 # test queuedelete 92 92 macro test3 93 93 $PASS = 1 94 94 queueinit dummy 95 95 queuepush dummy foobar … … 106 106 end 107 107 108 # test queuedelete 108 # test queuedelete memory 109 109 macro testmem3 110 110 $PASS = 1 111 111 list word -x "ps -p $PID -o rss" 112 112 $startmem = $word:1 … … 132 132 # test queuepush / queuepop 133 133 macro test4 134 134 $PASS = 1 135 135 queueinit dummy 136 136 queuepush dummy foobar … … 144 144 # test queuepush / queuepop 145 145 macro test4.1 146 146 $PASS = 1 147 147 queueinit dummy 148 148 queuepush dummy foo1 … … 168 168 end 169 169 170 # test queue delete170 # test queuepush / queuepop memory 171 171 macro testmem4.0 172 172 $PASS = 1 173 173 list word -x "ps -p $PID -o rss" 174 174 $startmem = $word:1 … … 192 192 end 193 193 194 # test queue delete194 # test queuepush / queuepop memory 195 195 macro testmem4.1 196 196 $PASS = 1 197 197 list word -x "ps -p $PID -o rss" 198 198 $startmem = $word:1 … … 216 216 end 217 217 218 # test queue delete218 # test queuepush / queuepop memory 219 219 macro testmem4.2 220 221 list word -x "ps -p $PID -o rss" 222 $startmem = $word:1 223 224 output /dev/null 225 for i 0 10000 226 queueinit dummy 227 queuepush dummy foobar 228 end 229 output stdout 230 231 list word -x "ps -p $PID -o rss" 232 $endmem = $word:1 233 234 if ({$endmem - $startmem} > 10) 235 $PASS = 0 236 echo "growth: {$endmem-$startmem}" 237 echo "kB/loop: {($endmem-$startmem)/10000}" 238 end 239 end 240 241 # test queue delete220 $PASS = 1 221 list word -x "ps -p $PID -o rss" 222 $startmem = $word:1 223 224 output /dev/null 225 for i 0 10000 226 queueinit dummy 227 queuepush dummy foobar 228 end 229 output stdout 230 231 list word -x "ps -p $PID -o rss" 232 $endmem = $word:1 233 234 if ({$endmem - $startmem} > 10) 235 $PASS = 0 236 echo "growth: {$endmem-$startmem}" 237 echo "kB/loop: {($endmem-$startmem)/10000}" 238 end 239 end 240 241 # test queuepush / queuepop memory 242 242 macro testmem4.3 243 243 $PASS = 1 244 244 list word -x "ps -p $PID -o rss" 245 245 $startmem = $word:1 … … 266 266 # test queuepush / queuepop with keys 267 267 macro test5 268 268 $PASS = 1 269 269 queueinit dummy 270 270 queuepush dummy "test 1 word" … … 278 278 end 279 279 280 # test queuepush / queuepop 280 # test queuepush / queuepop with keys 281 281 macro test5.1 282 282 $PASS = 1 283 283 queueinit dummy 284 284 queuepush dummy "test 1 word" … … 292 292 end 293 293 294 # test queuedelete294 # memory test for queuepush / queuepop with keys 295 295 macro testmem5.0 296 296 $PASS = 1 297 297 queueinit dummy 298 298 … … 322 322 end 323 323 324 # test queuedelete324 # memory test for queuepush / queuepop with keys 325 325 macro testmem5.1 326 326 $PASS = 1 327 327 queueinit dummy 328 328 … … 346 346 end 347 347 end 348
Note:
See TracChangeset
for help on using the changeset viewer.
