Update with current status
[gnash.git] / testsuite / actionscript.all / dejagnu.as
blob1b0fbe55075b1452a7518edf97009dd19f56ebc6
1 //
2 // Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software
3 // Foundation, Inc
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef _DEJAGNU_AS_
21 #define _DEJAGNU_AS_
23 // Define USE_XTRACE to use "visual" trace
24 #ifdef USE_XTRACE
25 # include "xtrace.as"
26 # define trace xtrace
27 #endif
29 // Include the other testing file so user can mix the two if they
30 // want. Both start with "PASSED", so they work with DejaGnu. They
31 // only differ in the types of data displayed. Differnt data for
32 // different folks works for me as long as the standard keywords are
33 // used to keep DejaGnu happy.
36 rcsid="dejagnu.as";
37 #include "check.as"
39 #define note(text) info(text)
41 #ifdef USE_DEJAGNU_MODULE
43 #define pass(text) pass_check(text + " [" + __LINE__ + "]")
44 #define fail(text) fail_check(text + " [" + __LINE__ + "]")
45 #define xpass(text) xpass_check(text + " [" + __LINE__ + "]")
46 #define xfail(text) xfail_check(text + " [" + __LINE__ + "]")
47 #define untested(text) untested_check(text + " [" + __LINE__ + "]")
48 #define unresolved(text) unresolved_check(text + " [" + __LINE__ + "]")
49 #define totals()
51 #else // ndef USE_DEJAGNU_MODULE
53 // Track our state
54 var passed = 0;
55 var failed = 0;
56 var xpassed = 0;
57 var xfailed = 0;
58 var untest = 0;
59 var unresolv = 0;
61 #if 0 // seems unused anyway
63 // Use dejagnu(<expression>)
64 // Make sure your expression doesn't contain single quotes
67 #define dejagnu(expr, text) \
68 if ( expr ) pass(text);\
70 // if ( expr ) pass(text);
71 // else fail(text);
72 #endif // unused block
74 // These are the four primary test states as required by the POSIX
75 // testing methodologies standard.
76 #define pass(text) passed++; trace("PASSED: " + text + " [" + __LINE__ + "]")
77 #define fail(text) failed++; trace("FAILED: " + text + " [" + __LINE__ + "]")
78 #define xpass(text) xpassed++; trace("XPASSED: " + text + " [" + __LINE__ + "]")
79 #define xfail(text) xfailed++; trace("XFAILED: " + text + " [" + __LINE__ + "]")
80 #define untested(text) untest++; trace("UNTESTED: " + text + " [" + __LINE__ + "]")
81 #define unresolved(text) unresolv++; trace("UNRESOLVED: " + text + " [" + __LINE__ + "]")
83 #define totals() \
84 trace("Totals:"); \
85 trace(" passed: " + passed ); \
86 trace(" failed: " + failed ); \
87 if (xfailed) trace(" expected failures: " + xfailed); \
88 if (xpassed) trace(" unexpected passes: " + xpassed); \
89 if (untest) trace(" untested: " + untest); \
90 if (unresolv) trace(" unresolved: " + unresolv); \
92 #endif // ndef USE_DEJAGNU_MODULE
94 #endif // _DEJAGNU_AS_