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.84 2003/06/01 21:30:06 nilsson Exp $ */ + /* $Id: test_pike.pike,v 1.85 2003/06/02 18:15:05 mast Exp $ */      import Stdio;      #if !constant(_verify_internals)   #define _verify_internals()   #endif      #if !constant(_dmalloc_set_name)   void _dmalloc_set_name(mixed ... args) {}   #endif      int foo(string opt)   {    if(opt=="" || !opt) return 1;    return (int)opt;   }    - int istty_cache; - int istty() - { -  if(!istty_cache) -  { - #ifdef __NT__ -  istty_cache=1; - #else -  istty_cache=!!Stdio.stdin->tcgetattr(); - #endif -  if(!istty_cache) -  { -  istty_cache=-1; -  }else{ -  switch(getenv("TERM")) -  { -  case "dumb": -  case "emacs": -  istty_cache=-1; -  } -  } -  } -  return istty_cache>0; - } + int maybe_tty = 1;      mapping(string:int) cond_cache=([]);      #if constant(thread_create)   #define HAVE_DEBUG   #endif      void bzot(string test)   {    array lines = test/"\n";
pike.git/bin/test_pike.pike:288:    {    case "no-watchdog":    use_watchdog=0;    break;       case "watchdog":    run_watchdog( (int)opt[1] );    break;       case "notty": -  istty_cache=-1; +  maybe_tty = 0;    break;       case "help":    write(doc);    return 0;       case "verbose": verbose+=foo(opt[1]); break;    case "prompt": prompt+=foo(opt[1]); break;    case "start": start=foo(opt[1]); start--; break;    case "end": end=foo(opt[1]); break;
pike.git/bin/test_pike.pike:464:    string testfile;    sscanf(type, "%s: test %d, expected result: %s", testfile, testno, type);       if (testfile) {    array split = testfile / ":";    testline = (int) split[-1];    testfile = split[..sizeof (split) - 2] * ":";    }       string pad_on_error = "\n"; -  if(istty()) +  if(maybe_tty && Terminfo.is_tty())    {    if(verbose<2) {    werror("test %d, line %d\r", e+1, testline);    pad_on_error = " \r";    }    }    else if(verbose){    if(skip) {    if(qmade) werror(" Made %d test%s.\n", qmade, qmade==1?"":"s");    qmade=0;
pike.git/bin/test_pike.pike:824:    exit(1);       if(successes+errors > end)    {    break testloop;    }       a=b=0;    }    -  if(istty()) +  if(maybe_tty && Terminfo.is_tty())    {    werror(" \r");    }    else if(verbose) {    if(!qskipp && !qmadep);    else if(!qskipp) werror("Made all tests\n");    else if(!qmadep) werror("Skipped all tests\n");    else if(qmade) werror(" Made %d test%s.\n", qmade, qmade==1?"":"s");    else if(qskipped) werror(" Skipped %d test%s.\n", qskipped, qskipped==1?"":"s");    }