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

File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.