Changeset 16894
- Timestamp:
- Mar 8, 2008, 11:30:10 AM (18 years ago)
- Location:
- trunk/Ohana/src/opihi/cmd.basic/test
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/cmd.basic/test/if.sh
r14176 r16894 13 13 test11 14 14 test12 15 test13a 15 16 test13 16 #test1417 test14 17 18 end 18 19 … … 201 202 end 202 203 204 205 # check memleaks 206 macro test13a 207 208 local a b i N 209 210 list word -x "ps -p $PID -o rss" 211 $startmem = $word:1 212 213 output /dev/null 214 $a = 1 215 for i 0 1000 216 if ($a == 1) 217 echo "run" 218 end 219 end 220 output stdout 221 222 list word -x "ps -p $PID -o rss" 223 $endmem = $word:1 224 225 if ({$endmem - $startmem} < 10) 226 $PASS = 1 227 else 228 $PASS = 0 229 echo "growth: {$endmem-$startmem}" 230 echo "kB/loop: {($endmem-$startmem)/1000}" 231 end 232 end 203 233 204 234 # check memleaks … … 213 243 $a = 1 214 244 $b = 2 215 for i 0 1000 0245 for i 0 1000 216 246 if (($a == 1) && ($b == 2)) 217 247 echo "run" … … 228 258 $PASS = 0 229 259 echo "growth: {$endmem-$startmem}" 230 echo "kB/loop: {($endmem-$startmem)/1000 0}"231 end 232 end 233 234 # memory test using break260 echo "kB/loop: {($endmem-$startmem)/1000}" 261 end 262 end 263 264 # memory test using continue 235 265 macro test14 236 266 … … 243 273 $a = 1 244 274 $b = 2 245 for i 0 1000 0275 for i 0 1000 246 276 if (($a == 1) && ($b == 2)) 247 break277 continue 248 278 echo "run" 249 279 end … … 259 289 $PASS = 0 260 290 echo "growth: {$endmem-$startmem}" 261 echo "kB/loop: {($endmem-$startmem)/10000}" 262 end 263 end 291 echo "kB/loop: {($endmem-$startmem)/1000}" 292 end 293 end 294 295 # memory test using continue 296 macro test15 297 298 local a b i N bool 299 300 list word -x "ps -p $PID -o rss" 301 $startmem = $word:1 302 303 output /dev/null 304 $a = 1 305 $b = 2 306 for i 0 1000 307 $bool = (($a == 1) && ($b == 2)) 308 end 309 output stdout 310 311 list word -x "ps -p $PID -o rss" 312 $endmem = $word:1 313 314 if ({$endmem - $startmem} < 10) 315 $PASS = 1 316 else 317 $PASS = 0 318 echo "growth: {$endmem-$startmem}" 319 echo "kB/loop: {($endmem-$startmem)/1000}" 320 end 321 end -
trunk/Ohana/src/opihi/cmd.basic/test/list.sh
r16059 r16894 117 117 $startmem = $word:1 118 118 119 for i 0 100 0119 for i 0 100 120 120 list check3 -x "ls /dev/null" 121 121 end … … 129 129 $PASS = 0 130 130 echo "growth: {$endmem-$startmem}" 131 echo "kB/loop: {($endmem-$startmem)/100 0}"131 echo "kB/loop: {($endmem-$startmem)/100}" 132 132 end 133 133 … … 153 153 $startmem = $word:1 154 154 155 for i 0 100 0155 for i 0 100 156 156 list check4 -x "cat list_test.txt" 157 157 end … … 165 165 $PASS = 0 166 166 echo "growth: {$endmem-$startmem}" 167 echo "kB/loop: {($endmem-$startmem)/100 0}"167 echo "kB/loop: {($endmem-$startmem)/100}" 168 168 end 169 169 -
trunk/Ohana/src/opihi/cmd.basic/test/output.sh
r16059 r16894 45 45 46 46 output /dev/null 47 for i 0 100 047 for i 0 100 48 48 output testout.txt 49 49 echo "This is a test." … … 59 59 $PASS = 0 60 60 echo "growth: {$endmem-$startmem}" 61 echo "kB/loop: {($endmem-$startmem)/100 0}"61 echo "kB/loop: {($endmem-$startmem)/100}" 62 62 end 63 63 end -
trunk/Ohana/src/opihi/cmd.basic/test/variable.sh
r10311 r16894 240 240 $PASS = 1 241 241 242 if (($?i == 1) || ($?N == 1)) 242 # a slightly weak test: depends on no prior macros defining variables 243 # with the names below 244 if (($?very_obscure_name == 1) || ($?another_obscure_name == 1)) 243 245 $PASS = 0 244 246 end
Note:
See TracChangeset
for help on using the changeset viewer.
