Branch: Tag:

2004-01-15

2004-01-15 17:48:40 by Martin Nilsson <mani@lysator.liu.se>

Don't accept warnings.

Rev: bin/test_pike.pike:1.91

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()
76:      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
582:    // _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;
619:    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)))
670:       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();
696:    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])) {