Roxen.git / server / etc / test / tests / pike_test_common.pike

version» Context lines:

Roxen.git/server/etc/test/tests/pike_test_common.pike:3:      constant single_thread = 0;   // If this constant is set then the test will run in the backend   // thread while all handler threads are on hold (which implies the   // background_run queue is on hold as well). Otherwise tests are run   // in one handler thread while another one is free to execute   // background jobs right away.      void create( int vb ) { verbose = vb; }    + function(:void) testloop_ping = lambda(){};      string describe_test (function|string cb, array args)   {    if (!stringp (cb)) {    object describer = master()->Describer();    return describer->describe (cb) +    "(" + describer->describe_comma_list (args, 512) + ")";    }    if (sizeof (args))    catch {return sprintf (cb, @args);};
Roxen.git/server/etc/test/tests/pike_test_common.pike:101:    }    else    report_debug(indent (2, "################ " +    describe_test (cb, args) + " FAILED\n"));    }       if( err )    report_debug( do_describe_error( err ) );    report_debug ("\n");    tests_failed++; +  testloop_ping();   }         void report_test_ok( mixed err, function|string|array cb, array args, int st )   {    if( verbose )    {    int tt = (gethrtime()-st);    if( tt > 200000 )    report_debug(" %4dms\n", tt/1000);    else    report_debug( " PASS\n" );    // if( err ) report_error( do_describe_error( err ) );    } -  +  testloop_ping();   }      private mixed test_generic_low( function check_return,    function|array cb,    bool throw_error,    mixed ... args )   {    current_test++;    mixed result;    report_1st( cb, args, check_return );
Roxen.git/server/etc/test/tests/pike_test_common.pike:454:   mixed assert_not_equal( mixed what, function|array f, mixed ... args )   {    return test_generic( check_not_equal( what ), f, @args );   }      void run_tests( Configuration c );      void low_run_tests( Configuration c,    function go_on )   { +  testloop_ping = c->get_provider("roxen_test")->testloop_ping || testloop_ping; +     mixed err = catch {    run_tests( c );    };    if( err ) {    write( "################ " + describe_backtrace( err ) );    go_on (++current_test, ++tests_failed);    }    else    go_on (++current_test, tests_failed);   }