pike.git / lib / modules / Tools.pmod / Shoot.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Tools.pmod/Shoot.pmod/module.pmod:56:   mapping(string:Test) tests()   {    if( !_tests )    {    _tests = ([]);    rtests = ([]);    foreach (indices(Tools.Shoot), string test)    {    program p;    Test t; -  if ((programp(p=Tools.Shoot[test])) && (t=p())->perform) +  if ((programp(p=Tools.Shoot[test])) && (t=p())->perform && !t->disabled)    {    if( !t->name )    exit(1,"The test %O does not have a name\n", t );    if( _tests[t->name] )    exit(1,"The tests %O and %O have the same name\n", t, _tests[t->name] );    _tests[t->name]=t;    rtests[t] = test;    }    }    } -  +     return _tests;   }      mapping(string:int|float) run(Test test, int maximum_seconds, float overhead)   {    Stdio.File fd = Stdio.File();    string test_name;    if( !rtests )    tests();       if( !(test_name = rtests[ test ]) )    error("Test %O is not a test\n", test);          Process.spawn_pike( ({"-e", sprintf("Tools.Shoot.run_sub( Tools.Shoot[%q](), %d, %f )",    test_name, maximum_seconds, overhead ) }),    (["stdout":fd->pipe()]));    return Standards.JSON.decode( fd->read() );   }