IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14176


Ignore:
Timestamp:
Jul 12, 2007, 2:26:24 PM (19 years ago)
Author:
eugene
Message:

added tests from Mark Pitts

Location:
trunk/Ohana/src/opihi
Files:
13 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.basic/test/for.sh

    r10647 r14176  
    88 memtest1
    99 memtest2
    10  memtest2a
    1110 memtest3
    1211end
     
    1514macro test1
    1615
     16  $PASS = 0
     17
    1718  local i
    1819
     
    3132macro test2
    3233
     34  $PASS = 0
     35
    3336  local i
    3437
     
    4750# do we loop up in small steps correctly?
    4851macro test3
     52
     53  $PASS = 0
    4954
    5055  local i N
     
    6873macro test4
    6974
     75  $PASS = 0
     76
    7077  local i N
    7178
     
    8794# do we break from a loop correctly
    8895macro test5
     96
     97  $PASS = 0
    8998
    9099  break -auto off
     
    112121macro memtest1
    113122
     123 $PASS = 0
     124
    114125 local i N
    115126
     
    136147macro memtest2
    137148
     149 $PASS = 0
     150
    138151 local i N
    139152
     
    163176end
    164177
    165 # check memleaks with many loop lines
    166 macro memtest2a
    167 
    168  local i N
    169 
    170  list word -x "ps -p $PID -o rss"
    171  $startmem = $word:1
    172 
    173  output /dev/null
    174  for i 0 10000
    175   echo "test line in loop"
    176   echo "test line in loop"
    177  end   
    178  output stdout
    179  
    180  list word -x "ps -p $PID -o rss"
    181  $endmem = $word:1
    182 
    183  $PASS = 1
    184 
    185  if ($endmem - $startmem > 10)
    186    $PASS = 0
    187    echo "growth: {$endmem-$startmem}"
    188    echo "kB/loop: {($endmem-$startmem)/10000}"
    189  end
    190 end
    191 
    192 # check memleaks with many loop lines
    193 macro memtest2b
    194 
    195  local i N
    196 
    197  list word -x "ps -p $PID -o rss"
    198  $startmem = $word:1
    199 
    200  output /dev/null
    201  for i 0 1000
    202   exec echo "test line in loop" > /dev/null
    203   exec echo "test line in loop" > /dev/null
    204  end   
    205  output stdout
    206  
    207  list word -x "ps -p $PID -o rss"
    208  $endmem = $word:1
    209 
    210  $PASS = 1
    211 
    212  if ($endmem - $startmem > 10)
    213    $PASS = 0
    214    echo "growth: {$endmem-$startmem}"
    215    echo "kB/loop: {($endmem-$startmem)/1000}"
    216  end
    217 end
    218 
    219178# check memleaks on break
    220179macro memtest3
     180
     181 $PASS = 0
    221182
    222183 local i N
     
    254215 end
    255216end
    256 
  • trunk/Ohana/src/opihi/cmd.basic/test/if.sh

    r10311 r14176  
    1414 test12
    1515 test13
    16  test14
     16# test14
    1717end
    1818
  • trunk/Ohana/src/opihi/cmd.basic/test/list.sh

    r10311 r14176  
    9292 $startmem = $word:1
    9393
    94  for i 0 10000
     94 for i 0 1000
    9595  list check2 -split This is a list
    96  end   
    97  
    98  list word -x "ps -p $PID -o rss"
    99  $endmem = $word:1
    100 
    101  $PASS = 1
    102 
    103  if ($endmem - $startmem > 10)
    104    $PASS = 0
    105    echo "growth: {$endmem-$startmem}"
    106    echo "kB/loop: {($endmem-$startmem)/10000}"
    107  end
    108 
    109 end
    110 
    111 # Memory test for list -x
    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 100
    120   list check3 -x "ls /etc"
    12196 end   
    12297 
     
    135110
    136111# 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...
     112macro 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
     134end
     135
     136# Memory test for list -x
    139137macro memtest4
    140138
     
    155153 $startmem = $word:1
    156154
    157  for i 0 100
     155 for i 0 1000
    158156  list check4 -x "cat list_test.txt"
    159157 end   
  • trunk/Ohana/src/opihi/cmd.basic/test/scan.sh

    r10311 r14176  
    5454 $startmem = $word:1
    5555
    56  for i 0 10000
     56 for i 0 1000
    5757  scan test_file.txt fscan
    5858 end   
     
    6666   $PASS = 0
    6767   echo "growth: {$endmem-$startmem}"
    68    echo "kB/loop: {($endmem-$startmem)/10000}"
     68   echo "kB/loop: {($endmem-$startmem)/1000}"
    6969 end
    7070
     
    9696 $startmem = $word:1
    9797
    98  for i 0 10000
     98 for i 0 1000
    9999  scan test_file.txt fscan 5
    100100 end   
     
    108108   $PASS = 0
    109109   echo "growth: {$endmem-$startmem}"
    110    echo "kB/loop: {($endmem-$startmem)/10000}"
     110   echo "kB/loop: {($endmem-$startmem)/1000}"
    111111 end
    112112
  • trunk/Ohana/src/opihi/cmd.basic/test/sleep.sh

    r10311 r14176  
    99 list tstart -x "date +%S"
    1010
    11  sleep 10
     11 sleep 3
    1212
    1313 list tend -x "date +%S"
    1414
    15  if ($tstart:0 >= 50)
     15 if ($tstart:0 >= 57)
    1616  $tend:0 = $tend:0 + 60
    1717 end
    1818
    19  $diff = abs (10 - abs($tstart:0 - $tend:0))
     19 $diff = abs (3 - abs($tstart:0 - $tend:0))
    2020
    2121 if ($diff > 1.1)
  • trunk/Ohana/src/opihi/cmd.basic/test/strlen.sh

    r10311 r14176  
    3030 $startmem = $word:1
    3131
    32  for i 0 10000
     32 for i 0 1000
    3333  strlen $tstr len
    3434 end   
     
    4242   $PASS = 0
    4343   echo "growth: {$endmem-$startmem}"
    44    echo "kB/loop: {($endmem-$startmem)/10000}"
     44   echo "kB/loop: {($endmem-$startmem)/1000}"
    4545 end
    4646
  • trunk/Ohana/src/opihi/cmd.basic/test/while.sh

    r10311 r14176  
    1212   $PASS = 0
    1313   echo "While loop failure!"
     14   echo "i: $i"
    1415   break
    1516  end
  • trunk/Ohana/src/opihi/cmd.data/test/peak.sh

    r9197 r14176  
    44 test2
    55 test3
    6  test4
    7  test5
     6 testmem1
    87end
    98
     
    7776
    7877# test memory usage
    79 macro test4
    80  $PASS = 1
     78macro testmem1
    8179 break -auto off
    8280
    83  create x 0 100
     81 create x 0 1000
    8482 set y = zero (x)
    85  y[60] = 2
    86  y[50] = 1
    87  y[40] = 2
     83 y[500] = 100
    8884
    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
    9390 end
    94  exec ps aux | grep mana | grep -v grep
     91 
     92 list word -x "ps -p $PID -o rss"
     93 $endmem = $word:1
    9594
    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
    97103end
    98 
    99 # test memory usage
    100 macro test5
    101  $PASS = 1
    102  break -auto off
    103 
    104  create x 0 100
    105  set y = zero (x)
    106  y[60] = 2
    107  y[50] = 1
    108  y[40] = 2
    109 
    110  echo "peak:"
    111  exec ps aux | grep mana | grep -v grep
    112  for i 0 1000
    113    peak x y 45 55
    114  end
    115  exec ps aux | grep mana | grep -v grep
    116 
    117  ## HOW do we test this?
    118 end
    119 
  • trunk/Ohana/src/opihi/cmd.data/test/periodogram.sh

    r6642 r14176  
    2323 if (abs ($peakpos - $P) > 0.5)
    2424   $PASS = 0
     25   echo "OFFSET: {$peakpos - $P}"
    2526 end
    2627end
     
    9091 periodogram t f 2 30 period power
    9192
    92   lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
    93   lim -n 1 period power; clear; box; plot period power
     93#  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
    9495
    9596 peak -q period power
  • trunk/Ohana/src/opihi/cmd.data/test/queues.sh

    r9359 r14176  
    2121# test queueinit
    2222macro test1
    23 
     23 $PASS = 1
    2424 queueinit dummy
    2525 queuesize dummy -var N
     
    3030end
    3131
    32 # test queueinit
     32# test queueinit memory
    3333macro testmem1
    34 
     34 $PASS = 1
    3535 list word -x "ps -p $PID -o rss"
    3636 $startmem = $word:1
     
    5454# test queuesize
    5555macro test2
    56 
     56 $PASS = 1
    5757 queueinit dummy
    5858 queuepush dummy foobar
     
    6464end
    6565
    66 # test queuesize
     66# test queuesize memory
    6767macro testmem2
    68 
     68 $PASS = 1
    6969 queueinit dummy
    7070 queuepush dummy foobar
     
    9191# test queuedelete
    9292macro test3
    93 
     93 $PASS = 1
    9494 queueinit dummy
    9595 queuepush dummy foobar
     
    106106end
    107107
    108 # test queuedelete
     108# test queuedelete memory
    109109macro testmem3
    110 
     110 $PASS = 1
    111111 list word -x "ps -p $PID -o rss"
    112112 $startmem = $word:1
     
    132132# test queuepush / queuepop
    133133macro test4
    134 
     134 $PASS = 1
    135135 queueinit dummy
    136136 queuepush dummy foobar
     
    144144# test queuepush / queuepop
    145145macro test4.1
    146 
     146 $PASS = 1
    147147 queueinit dummy
    148148 queuepush dummy foo1
     
    168168end
    169169
    170 # test queuedelete
     170# test queuepush / queuepop memory
    171171macro testmem4.0
    172 
     172 $PASS = 1
    173173 list word -x "ps -p $PID -o rss"
    174174 $startmem = $word:1
     
    192192end
    193193
    194 # test queuedelete
     194# test queuepush / queuepop memory
    195195macro testmem4.1
    196 
     196 $PASS = 1
    197197 list word -x "ps -p $PID -o rss"
    198198 $startmem = $word:1
     
    216216end
    217217
    218 # test queuedelete
     218# test queuepush / queuepop memory
    219219macro 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 queuedelete
     220 $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
     239end
     240
     241# test queuepush / queuepop memory
    242242macro testmem4.3
    243 
     243 $PASS = 1
    244244 list word -x "ps -p $PID -o rss"
    245245 $startmem = $word:1
     
    266266# test queuepush / queuepop with keys
    267267macro test5
    268 
     268 $PASS = 1
    269269 queueinit dummy
    270270 queuepush dummy "test 1 word"
     
    278278end
    279279
    280 # test queuepush / queuepop
     280# test queuepush / queuepop with keys
    281281macro test5.1
    282 
     282 $PASS = 1
    283283 queueinit dummy
    284284 queuepush dummy "test 1 word"
     
    292292end
    293293
    294 # test queuedelete
     294# memory test for queuepush / queuepop with keys
    295295macro testmem5.0
    296 
     296 $PASS = 1
    297297 queueinit dummy
    298298
     
    322322end
    323323
    324 # test queuedelete
     324# memory test for queuepush / queuepop with keys
    325325macro testmem5.1
    326 
     326 $PASS = 1
    327327 queueinit dummy
    328328
     
    346346 end
    347347end
    348 
Note: See TracChangeset for help on using the changeset viewer.