-
Notifications
You must be signed in to change notification settings - Fork 17
/
testsuite.ch
74 lines (61 loc) · 2.15 KB
/
testsuite.ch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef _TESTSUITE_CH
#define _TESTSUITE_CH
#xcommand TestSuite <cName> ;
[ <description: Description> <cDesc> ] ;
[ <verbose: Verbose> ] ;
=> ;
Static __NAME__ := <(cName)> ;;
Static __DESC__ := <cDesc> ;;
Static __VERBOSE__ := <.verbose.> ;;
_ObjNewClass( TestSuite_<cName>, LongNameClass ) ;;
_ObjClassMethod( New, ( cName, cDescription ), ) ;;
_ObjClassMethod( Expect, ( xExpr ), ) ;;
_ObjClassData( cDescription, String, , <cDesc> ) ;;
_ObjClassData( cName, String, , <(cName)> ) ;;
_ObjClassData( oParent, String, , )
#xcommand EndTestSuite => _ObjEndClass()
#xcommand Feature <cFeat> ;
[ <description: Description> <cDesc> ] ;
=> ;
_ObjClassMethod( Feat_<cFeat>, , ) ;;
_ObjClassData( cDescription_Feat<cFeat>, String, , <cDesc> )
#xcommand Enable Before ;
=> ;
_ObjClassMethod( Before, , )
#xcommand Before TestSuite <cSuite> ;
=> ;
Function ___TestSuite_<cSuite>____Before()
#xcommand Enable Environment <cCompany> <cBranch> ;
=> ;
_ObjClassData( cDescription_Company, String, , <cCompany> ) ;;
_ObjClassData( cDescription_Branch, String, , <cBranch> )
#xcommand Feature <cFeat> ;
TestSuite <cSuite> ;
=> ;
Function ___TestSuite_<cSuite>____Feat_<cFeat>()
#xcommand CompileTestSuite <cSuite> ;
=> ;
Function ___TestSuite_<cSuite>____New( cName, cDescription ) ;;
Self:oParent := TestSuite():New( cName, cDescription ) ;;
Return Self ;;
Function ___TestSuite_<cSuite>____Expect( xExpr ) ;;
Return FluentExpr():New( xExpr ) ;;
Function U_<cSuite> ;;
Local oTester := TestSuite_<cSuite>():New( __NAME__, __DESC__ ) ;;
oTester:oParent:lVerbose := __VERBOSE__ ;;
oTester:oParent:Run( oTester ) ;;
Return 0
#include 'fileio.ch'
Static Function ReadFileContents( cFileName )
Local nHandler := FOpen( cFileName, FO_READWRITE + FO_SHARED )
Local nSize := 0
Local xBuffer := ''
If -1 == nHandler
Return Nil
EndIf
nSize := FSeek( nHandler, 0, FS_END )
FSeek( nHandler, 0 )
FRead( nHandler, xBuffer, nSize )
FClose( nHandler )
Return xBuffer
#endif // _TESTSUITE_CH