pike.git / lib / modules / Tools.pmod / Standalone.pmod / benchmark.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/benchmark.pike:1: - // $Id: benchmark.pike,v 1.3 2002/12/17 19:49:34 per Exp $ + // $Id: benchmark.pike,v 1.4 2003/01/19 18:47:44 nilsson Exp $      constant description = "Runs some built in Pike benchmarks.";   constant help = #"   Benchmarks Pike with %d built in benchmark tests.   Arguments:      -h, --help    Shows this help text.      -m<number>, --max-runs=<number>    Runs a test at most <number> of times. Defaults to 25.      -s<number>, --max-seconds=<number>    Runs a test at most <number> of seconds, rounded up to the closest    complete test. Defaults to 5.      -t<glob>, --tests=<glob>    Only run the specified tests.   ";    - int(0..0) main(int num, array(string) args) + int(0..) main(int num, array(string) args)   {    mapping(string:Tools.Shoot.Test) tests=([]);    array results=({});       foreach (indices(Tools.Shoot);;string test)    {    program p;    Tools.Shoot.Test t;    if ((programp(p=Tools.Shoot[test])) &&    (t=p())->perform)
pike.git/lib/modules/Tools.pmod/Standalone.pmod/benchmark.pike:51:    case "maxrun":    maximum_runs = (int)opt[1];    break;    case "maxsec":    seconds_per_test = (int)opt[1];    break;    case "tests":    test_glob = opt[1];    }    -  Tools.Shoot.ExecTest("Overhead",Tools.Shoot.Overhead()) +  int ecode; +  ecode += Tools.Shoot.ExecTest("Overhead",Tools.Shoot.Overhead())    ->run(0,1,1); // fill caches       write("test total user mem (runs)\n");      /* always run overhead check first */    foreach (glob(test_glob,({"Overhead"})+(sort(indices(tests))-({"Overhead"})));;string id)    { -  Tools.Shoot.ExecTest(id,tests[id]) +  ecode += Tools.Shoot.ExecTest(id,tests[id])    ->run(seconds_per_test,maximum_runs);    } -  +  return ecode;   }