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.108 2005/04/09 03:11:28 nilsson Exp $ */ + /* $Id: test_pike.pike,v 1.109 2006/06/16 16:26:41 grubba 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:82:    if(!has_suffix(tests, "END\n"))    werror("%s: Missing end marker.\n", fn);    else    tests = tests[..sizeof(tests)-1-4];    }       tests = tests/"\n....\n";    return tests[0..sizeof(tests)-2];   }    + mapping(string:int) pushed_warnings = ([]); +    class WarningFlag {    int(0..1) warning;    array(string) warnings = ({});       void compile_warning(string file, int line, string text) { -  +  if (pushed_warnings[text]) return;    warnings += ({ line+": "+text });    warning = 1;    }       void compile_error(string file, int line, string text) {    werror("%s:%d: %s\n", file,line,text);    }   }      //
pike.git/bin/test_pike.pike:894:    werror(pad_on_error + fname + " failed.\n");    print_code(test);    werror(sprintf("o->a(): %O\n",a));    errors++;    }    else {    successes++;    }    break;    +  case "PUSH_WARNING": +  if (!stringp(a)) { +  werror(pad_on_error + fname + " failed.\n"); +  print_code(test); +  werror(sprintf("o->a(): %O\n", a)); +  } else { +  pushed_warnings[a]++; +  } +  break; +  +  case "POP_WARNING": +  if (!stringp(a)) { +  werror(pad_on_error + fname + " failed.\n"); +  print_code(test); +  werror(sprintf("o->a(): %O\n", a)); +  } else if (pushed_warnings[a]) { +  if (!--pushed_warnings[a]) { +  m_delete(pushed_warnings, a); +  } +  } else { +  werror(pad_on_error + fname + " failed.\n"); +  print_code(test); +  werror(sprintf("o->a(): %O not pushed!\n", a)); +  } +  break; +     case "RUN":    successes++;    break;       case "RUNCT":    if(!a || !arrayp(a) || sizeof(a)!=2 || !intp(a[0]) || !intp(a[1])) {    werror(pad_on_error + fname + " failed to return proper results.\n");    print_code(test);    werror(sprintf("o->a(): %O\n",a));    errors++;