Changeset 2228 for trunk/test/Suite.cc


Ignore:
Timestamp:
Mar 25, 2010, 1:28:14 PM (12 years ago)
Author:
Peter
Message:

Using the parallel-tests driver. All tests are now by default verbose,
but 'make check' is still silent and the output is collected in log
files. Please refer to test/README or the Automake manual for more
details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/Suite.cc

    r2121 r2228  
    3939
    4040  Suite::Suite(int argc, char* argv[])
    41     : dev_null_(NULL), known_issues_(0), ok_(true)
     41    : known_issues_(0), ok_(true)
    4242  {
    43     char* buffer=std::getenv("YAT_TEST_VERBOSE");
    44     if (buffer)
    45       std::cerr << "WARNING: environment variable `YAT_TEST_VERBOSE' "
    46                 << "is deprecated\n  use `VERBOSE' instead.\n";
    47     char* env_verbose=std::getenv("VERBOSE");
    48 
    49     if ( (argc>1 && argv[1]==std::string("-v")) ||
    50          (buffer && buffer == std::string("1")) ||
    51          env_verbose) {
    52       verbose_ = true;
    53       // synchronize cerr and cout, i.e., cout is flushed before
    54       // writing anything to cerr.
    55       std::cerr.tie(&std::cout);
    56     }
    57     else {
    58       verbose_ = false;
    59       dev_null_ = new std::ofstream("/dev/null");
    60       if (argc>1){
    61         std::stringstream ss(argv[0]);
    62         std::string prog;
    63         while(getline(ss, prog, '/'));
    64         if (prog.substr(0,3)=="lt-")
    65           prog = prog.substr(3);
    66         std::cout << prog << " -v : for printing extra information\n";
    67       }
    68     }
     43    // synchronize cerr and cout, i.e., cout is flushed before
     44    // writing anything to cerr.
     45    std::cerr.tie(&std::cout);
    6946  }
    7047
     
    7249  Suite::~Suite(void)
    7350  {
    74     if (dev_null_)
    75       delete dev_null_;
    7651  }
    7752
     
    9267  std::ostream& Suite::err(void) const
    9368  {
    94     if (verbose_)
    95       return std::cerr;
    96     return *dev_null_;
     69    return std::cerr;
    9770  }
    9871
     
    144117  std::ostream& Suite::out(void) const
    145118  {
    146     if (verbose_)
    147       return std::cout;
    148     return *dev_null_;
     119    return std::cout;
    149120  }
    150121
Note: See TracChangeset for help on using the changeset viewer.