IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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/cmd.data/test
Files:
8 added
3 edited

Legend:

Unmodified
Added
Removed
  • 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.