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

version» Context lines:

Roxen.git/server/etc/test/tests/pike_async_process_test_common.pike:1:   int verbose;   Configuration c;   function do_when_done;      string http_url;   int current_test, tests_failed;   Process.Process test;    + mapping all_tests = ([]);   string indent( int l, string what )   {    array q = what/"\n";   // if( q[-1] == "" ) q = q[..sizeof(q)-2];    string i = (" "*l+"| ");    return i+q*("\n"+i)+"\n";   }      string do_describe_error( mixed err )   {
Roxen.git/server/etc/test/tests/pike_async_process_test_common.pike:50:       test = Process.create_process( ({    "pike",    combine_path( __FILE__, "../"+p ),    http_url    })+args );   }      void current_test_done()   { - #define IND(X) this_object()[ "test_"+current_test+(X) ] + #define IND(X) all_tests[ current_test+(X) ]    if( !test || test->status() )    {    if( function fp = IND("_check") )    if( string fail = fp( ) )    {    tests_failed++;    if( verbose ) report_debug(" FAILED\n");    report_debug(do_describe_error(IND("_desc")+" FAILED\n" ));    report_debug(do_describe_error( fail ));    }
Roxen.git/server/etc/test/tests/pike_async_process_test_common.pike:95:            void low_run_tests( Configuration _c, function go_on )   {    do_when_done = go_on;    c = _c;    call_out( current_test_done, 0 );   }    -  + void setup();   void create( int v )   {    verbose = v; -  +  setup();   } -  +  +  + int dt; + void atest( string n, +  function t, +  function c ) + { +  dt++; +  all_tests[ dt+"_desc" ] = n; +  all_tests[ dt+"" ] = t; +  all_tests[ dt+"_check" ] = c; + }