unit_test_logger.h File Reference


Defines

#define EXPAND_(a)   #a
#define EXPAND(a)   EXPAND_(a)
#define __FILELINE__   __FILE__ ":" EXPAND(__LINE__)
#define TICK(x)   do { if (log_level <= 1) std::cerr << x << std::flush; } while(0)
#define fail(x)
 Fails a unit test and prints a message.
#define assert(x)
 Makes an assertion.
#define ECHO2(x, y)   std::cerr << x << ": " << y << std::endl
#define TRACE2(x, y)   do { if(log_level > 3) ECHO2(x,y); } while(0)
#define LOG2(x, y)   do { if (log_level > 2) ECHO2(x,y); } while(0)
#define INFO2(x, y)   do { if (log_level > 1) ECHO2(x,y); } while(0)
#define WARN2(x, y)   do { if (log_level > 0) ECHO2(x,y); } while(0)
#define ECHO(x)   std::cerr << x << std::endl
#define TRACE(x)   do { if (log_level > 3) ECHO(x); } while(0)
#define LOG(x)   do { if (log_level > 2) ECHO(x); } while(0)
#define INFO(x)   do { if (log_level > 1) ECHO(x); } while(0)
#define WARN(x)   do { if (log_level > 0) ECHO(x); } while(0)

Variables

int status
 holds current unit test status value.
int log_level
 Log level.


Define Documentation

#define EXPAND_ (  )     #a

#define EXPAND (  )     EXPAND_(a)

#define __FILELINE__   __FILE__ ":" EXPAND(__LINE__)

#define TICK (  )     do { if (log_level <= 1) std::cerr << x << std::flush; } while(0)

#define fail (  ) 

Value:

++status; \
    WARN2("test",std::endl << x); \
    throw "failed";
Fails a unit test and prints a message.

#define assert (  ) 

Value:

if (!(x)) { \
        fail("assertion " #x " failed at " __FILELINE__); \
    }
Makes an assertion.

#define ECHO2 ( x,
 )     std::cerr << x << ": " << y << std::endl

#define TRACE2 ( x,
 )     do { if(log_level > 3) ECHO2(x,y); } while(0)

#define LOG2 ( x,
 )     do { if (log_level > 2) ECHO2(x,y); } while(0)

#define INFO2 ( x,
 )     do { if (log_level > 1) ECHO2(x,y); } while(0)

#define WARN2 ( x,
 )     do { if (log_level > 0) ECHO2(x,y); } while(0)

#define ECHO (  )     std::cerr << x << std::endl

#define TRACE (  )     do { if (log_level > 3) ECHO(x); } while(0)

#define LOG (  )     do { if (log_level > 2) ECHO(x); } while(0)

#define INFO (  )     do { if (log_level > 1) ECHO(x); } while(0)

#define WARN (  )     do { if (log_level > 0) ECHO(x); } while(0)


Variable Documentation

int status

holds current unit test status value.

0 is okay, non-zero value means failure.

int log_level

Log level.


Genereated on Tue Mar 11 19:26:09 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.