5 #include "gnashconfig.h"
12 #define HAVE_DEJAGNU_H 1 // we ship our own now...
16 #define info(x) note x
19 //#warning "You should install DejaGnu! Using stubs for pass/fail/xpass/xfail..."
23 void pass(std::string s
) { std::cout
<< "PASSED: " << s
<< std::endl
; };
24 void xpass(std::string s
) { std::cout
<< "XPASSED: " << s
<< std::endl
; };
25 void fail(std::string s
) { std::cout
<< "FAILED: " << s
<< std::endl
; };
26 void xfail(std::string s
) { std::cout
<< "XFAILED: " << s
<< std::endl
; };
27 void unresolved(std::string s
) { std::cout
<< "UNRESOLVED: " << s
<< std::endl
; };
30 #define info(x) { printf("NOTE: "); printf x; putchar('\n'); }
36 #define check_equals_label(label, expr, expected) \
38 std::stringstream ss; \
39 if ( ! label.empty() ) ss << label << ": "; \
40 if ( expr == expected ) \
42 ss << #expr << " == " << expected; \
43 ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
44 _runtest.pass(ss.str().c_str()); \
48 ss << #expr << " == '" << expr << "' (expected: " \
50 ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
51 _runtest.fail(ss.str().c_str()); \
55 #define xcheck_equals_label(label, expr, expected) \
57 std::stringstream ss; \
58 if ( label != "" ) ss << label << ": "; \
59 if ( expr == expected ) \
61 ss << #expr << " == " << expected; \
62 ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
63 _runtest.xpass(ss.str().c_str()); \
67 ss << #expr << " == '" << expr << "' (expected: " \
69 ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
70 _runtest.xfail(ss.str().c_str()); \
74 #define check_equals(expr, expected) check_equals_label(std::string(), expr, expected)
76 #define xcheck_equals(expr, expected) xcheck_equals_label(std::string(), expr, expected)
80 std::stringstream ss; \
82 ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
84 _runtest.pass(ss.str().c_str()); \
86 _runtest.fail(ss.str().c_str()); \
90 #define xcheck(expr) \
92 std::stringstream ss; \
94 ss << " [" << __FILE__ << ":" << __LINE__ << "]"; \
96 _runtest.xpass(ss.str().c_str()); \
98 _runtest.xfail(ss.str().c_str()); \