Changeset 2228
- Timestamp:
- Mar 25, 2010, 1:28:14 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.ac
r2227 r2228 48 48 49 49 AC_CONFIG_HEADERS([config.h]) 50 AM_INIT_AUTOMAKE([1.11 std-options color-tests ])50 AM_INIT_AUTOMAKE([1.11 std-options color-tests parallel-tests]) 51 51 52 52 dnl The empty help-string for --with-gsl-prefix and -
trunk/test/README
r2121 r2228 7 7 ======== 8 8 9 Running alltests9 Running the tests 10 10 ----------------- 11 11 12 make check12 To run all tests: 13 13 14 make check 15 16 To run only failed tests: 17 18 make recheck 19 20 To run only a subset of tests, use TESTS variable: 21 22 make check TESTS="first_test second_test" 23 24 To enable test output you can use the VERBOSE variable 25 26 make check VERBOSE=1 14 27 15 28 Interpretation … … 31 44 ----------------------------- 32 45 33 You can run a specific test directly. Add a '-v' flag to trigger verbosity 34 35 ./program_test -v 36 37 If you want to run the test suite in verbose mode, you can invoke 38 make as follows: 39 40 env VERBOSE=1 make -e check 41 42 If you want to run only a subset of tests, you can invoke make as follows 43 44 env TESTS="first_test second_test" make -e check 46 You can run the test directly, `./foo_test'; it will be verbose. The 47 verbose output is also available in `foo_test.log'. A summary log is 48 created in the file `test-suite.log'. 45 49 46 50 … … 69 73 test::Suite::return_value()). If the test should be skipped for some 70 74 reason it shall return 77. 71 72 When a test is run without verbose flag, it should be silent also at73 failure. Achieve this behaviour by sending output through74 test::Suite class (see functions err() and out()).75 75 76 76 When writing numerical tests, it is typically desired to allow for -
trunk/test/Suite.cc
r2121 r2228 39 39 40 40 Suite::Suite(int argc, char* argv[]) 41 : dev_null_(NULL),known_issues_(0), ok_(true)41 : known_issues_(0), ok_(true) 42 42 { 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); 69 46 } 70 47 … … 72 49 Suite::~Suite(void) 73 50 { 74 if (dev_null_)75 delete dev_null_;76 51 } 77 52 … … 92 67 std::ostream& Suite::err(void) const 93 68 { 94 if (verbose_) 95 return std::cerr; 96 return *dev_null_; 69 return std::cerr; 97 70 } 98 71 … … 144 117 std::ostream& Suite::out(void) const 145 118 { 146 if (verbose_) 147 return std::cout; 148 return *dev_null_; 119 return std::cout; 149 120 } 150 121 -
trunk/test/Suite.h
r2202 r2228 155 155 156 156 private: 157 std::ofstream* dev_null_;158 157 unsigned int known_issues_; 159 158 bool ok_; 160 bool verbose_;161 162 159 }; 163 160 -
trunk/test/common_defs.sh.in
r2225 r2228 49 49 50 50 me=$0 51 52 while test $# -gt 0; do53 case "$1" in54 -v)55 VERBOSE=156 ;;57 esac58 shift59 done60 61 if test -n "$YAT_TEST_VERBOSE"; then62 VERBOSE=YAT_TEST_VERBOSE;63 echo "WARNING: environment variable \`YAT_TEST_VERBOSE' is deprecated;";64 echo " use \`VERBOSE' instead.";65 fi66 67 if test -z "$VERBOSE"; then68 exec > /dev/null 2>&169 fi70 51 71 52 echo "=== Running $me ===" … … 170 151 171 152 # turn on shell traces when in verbose mode 172 if test -n "$VERBOSE"; then 173 set -x 174 fi 153 set -x -
trunk/test/documentation_test.sh.in
r2202 r2228 25 25 have_doxygen="@have_doxygen@" 26 26 27 while test $# -gt 0; do28 case "$1" in29 -v)30 VERBOSE=131 ;;32 esac33 shift34 done35 36 if test -n "$YAT_TEST_VERBOSE"; then37 VERBOSE=YAT_TEST_VERBOSE;38 echo "WARNING: environment variable \`YAT_TEST_VERBOSE' is deprecated;";39 echo " use \`VERBOSE' instead.";40 fi41 42 if test -z "$VERBOSE"; then43 exec > /dev/null 2>&144 fi45 46 27 if test $have_doxygen = "no"; then 47 28 echo Skipped;
Note: See TracChangeset
for help on using the changeset viewer.