pike.git / bin / test_pike.pike

version» Context lines:

pike.git/bin/test_pike.pike:1:   #! /usr/bin/env pike    - /* $Id: test_pike.pike,v 1.90 2003/10/13 15:23:50 grubba Exp $ */ + /* $Id: test_pike.pike,v 1.91 2004/01/15 17:48:40 nilsson Exp $ */      #if !constant(_verify_internals)   #define _verify_internals()   #endif      #if !constant(_dmalloc_set_name)   void _dmalloc_set_name(mixed ... args) {}   #endif      int foo(string opt)
pike.git/bin/test_pike.pike:69:    fn, errno());    exit(1);    }       tests = tests/"\n....\n";    return tests[0..sizeof(tests)-2];   }      class WarningFlag {    int(0..1) warning; +  array(string) warnings = ({});    -  void compile_warning(mixed ... args) { +  void compile_warning(string file, int line, string text) { +  warnings += ({ line+": "+text });    warning = 1;    } -  +  +  void compile_error(string file, int line, string text) { +  werror("%s:%d: %s\n", file,line,text);    } -  + }      //   // Watchdog stuff   //      // 20 minutes should be enough..   #if !constant(_reset_dmalloc)   #define WATCHDOG_TIMEOUT 60*20   #else   // ... unless we're running dmalloc
pike.git/bin/test_pike.pike:575:       if((shift/3)&1)    {    fname+=" (CRNL)";    to_compile=replace(to_compile,"\n","\r\n");    }       // _optimizer_debug(5);       if(verbose>9) print_code(to_compile); +  WarningFlag wf;    switch(type)    {    mixed at,bt;    mixed err;    case "COMPILE": -  +  wf = WarningFlag(); +  master()->set_inhibit_compile_errors(wf);    _dmalloc_set_name(fname,0);    if(catch(compile_string(to_compile, testsuite)))    {    _dmalloc_set_name(); -  +  master()->set_inhibit_compile_errors(0);    werror(pad_on_error + fname + " failed.\n");    print_code(test);    errors++;    }    else {    _dmalloc_set_name(); -  +  master()->set_inhibit_compile_errors(0); +  +  if(wf->warning) { +  werror(pad_on_error + fname + " produced warning.\n"); +  werror("%{%s\n%}", wf->warnings); +  print_code(test); +  errors++; +  break; +  } +     successes++;    }    break;       case "COMPILE_ERROR":    master()->set_inhibit_compile_errors(1);    _dmalloc_set_name(fname,0);    if(catch(compile_string(to_compile, testsuite)))    {    _dmalloc_set_name();
pike.git/bin/test_pike.pike:612:    else {    _dmalloc_set_name();    werror(pad_on_error + fname + " failed (expected compile error).\n");    print_code(test);    errors++;    }    master()->set_inhibit_compile_errors(0);    break;       case "COMPILE_WARNING": -  WarningFlag wf = WarningFlag(); +  wf = WarningFlag();    master()->set_inhibit_compile_errors(wf);    _dmalloc_set_name(fname,0);    if(catch(compile_string(to_compile, testsuite)))    {    _dmalloc_set_name();    werror(pad_on_error + fname + " failed.\n");    print_code(test);    errors++;    }    else {
pike.git/bin/test_pike.pike:663:    werror(pad_on_error + fname + " failed (expected eval error).\n");    werror("Got %O\n", a);    print_code(test);    errors++;    }    master()->set_inhibit_compile_errors(0);    break;       default:    if (err = catch{ +  wf = WarningFlag(); +  master()->set_inhibit_compile_errors(wf);    _dmalloc_set_name(fname,0);    o=compile_string(to_compile,testsuite)();    _dmalloc_set_name();       if(check > 1) _verify_internals();       a=b=0;    if(t) trace(t);    _dmalloc_set_name(fname,1);    if(functionp(o->a))
pike.git/bin/test_pike.pike:689:    if(functionp(o->b))    {    bt = gauge { b=o->b(); };    }       _dmalloc_set_name();       if(t) trace(0);    if(check > 1) _verify_internals();    +  if(wf->warning) { +  werror(pad_on_error + fname + " produced warning.\n"); +  werror("%{%s\n%}", wf->warnings); +  print_code(test); +  errors++; +  break; +  } +  master()->set_inhibit_compile_errors(0); +     }) { -  // trace(0); +  if(t) trace(0); +  master()->set_inhibit_compile_errors(0);    werror(pad_on_error + fname + " failed.\n");    print_code(test);    if (arrayp(err) && sizeof(err) && stringp(err[0])) {    werror("Error: " + master()->describe_backtrace(err));    }    if (objectp(err)) {    werror("Error: " + master()->describe_backtrace(err));    }    errors++;    break;