Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove useless double parentheses in function calls.
[simgrid.git] / win32_test_app / include / TTestSuite.h
1 #ifndef __TestSuite_H__
2 #define __TestSuite_H__
3
4 #include <TStream.h>
5 #include <TThreadDynarray.h>
6
7 /*
8  * Declaration of the s_TestSuite, which represents
9  * a suite of tests.
10  */
11 typedef struct s_TestSuite {
12   TestCaseContext_t test_case_context;  /* the context of the current test case */
13   Stream_t stream;              /* stdin or file stream                                 */
14   size_t testCaseCount;         /* test case count                                              */
15   size_t successCount;          /* test case success count                              */
16   size_t failureCount;          /* test case failure count                              */
17 #ifdef __VERBOSE
18   char currentTime[30];         /* the current time                                             */
19 #endif                          /* #ifdef __VERBOSE */
20   ThreadDynarray_t threads;
21 } s_TestSuite_t, *TestSuite_t;
22
23 /* 
24  * s_TestSuite connected functions.
25  */
26
27 /*
28  * Create a new s_TestSuite an returns a pointer to self.
29  */
30 TestSuite_t TestSuite_new(void);
31
32 /* 
33  * Free the s_TestSuite pointed to by ptr.
34  */
35 void TestSuite_free(TestSuite_t ptr);
36
37  /*
38   * Initialize the s_TestSuite structure.
39   */
40 errno_t TestSuite_initialize(TestSuite_t ptr, int argc, char *argv[]);
41
42
43 /*
44  * This function reads an entire line, storing 
45  * the address of the buffer containing the  text into  
46  * s_TestSuite.current_line. 
47  */
48 ssize_t TestSuite_getline(TestSuite_t ptr, size_t * len);
49
50 /* 
51  * Launch the test suite. 
52  */
53 void TestSuite_run(TestSuite_t ptr);
54
55 /* 
56  * Meta command processing.
57  */
58 errno_t TestSuite_processMetaCommand(TestSuite_t testSuite);
59
60 /* 
61  * Set the timeout of the test case context of the
62  * test suite.
63  */
64 void TestSuite_setTimeout(TestSuite_t testSuite);
65
66 /*
67  * Enable output checking for the current test case context.
68  */
69 void TestSuite_enableOutputChecking(TestSuite_t testSuite);
70
71 /*
72  * Disable output checking for the current test case context.
73  */
74 void TestSuite_disableOutputChecking(TestSuite_t testSuite);
75
76 /*
77  * Enable post output checking for the current test case context.
78  */
79 void TestSuite_enablePostOutputChecking(TestSuite_t testSuite);
80
81 /*
82  * Disable post output checking for the current test case context.
83  */
84 void TestSuite_disablePostOutputChecking(TestSuite_t testSuite);
85
86 /*
87  * Set the expected exit code of the current test case context of the test suite.
88  */
89 void TestSuite_setExpectedExitCode(TestSuite_t testSuite);
90
91 /*
92  * Export a variable in the environment of the current test_runner.exe process.
93  */
94 errno_t TestSuite_export(TestSuite_t testSuite);
95
96 /*
97  * Expected child output processing.
98  */
99 errno_t TestSuite_processExpectedChildOutput(TestSuite_t testSuite);
100
101 /*
102  * Child input processing.
103  */
104 errno_t TestSuite_processChildInput(TestSuite_t testSuite);
105
106 /*
107  * Check the child output.
108  */
109 errno_t TestSuite_checkChildOutput(TestCaseContext_t context);
110
111 /*
112  * Print message
113  */
114 void TestSuite_print(const char *str);
115
116 /*
117  * Check the child process exit code.
118  */
119 errno_t TestSuite_checkChildExitCode(TestCaseContext_t context);
120
121 errno_t TestSuite_unset(TestSuite_t testSuite);
122
123 void TestSuite_createConsole(TestSuite_t testSuite);
124
125 void TestSuite_createNoConsole(TestSuite_t testSuite);
126
127 void TestSuite_enableExitCodeChecking(TestSuite_t testSuite);
128
129 void TestSuite_disableExitCodeChecking(TestSuite_t testSuite);
130
131 unsigned long WINAPI TestSuite_runSyncTestCase(void *param);
132
133 errno_t TestSuite_runAsyncTestCase(TestSuite_t testSuite);
134
135 /* 
136  * Terminate the test suite.
137  */
138 void TestSuite_terminate(TestSuite_t testSuite);
139
140 unsigned long WINAPI TestSuite_asyncReadChildOutput(void *param);
141
142 bool TestSuite_iSPostOutputCheckingEnabled(TestCaseContext_t context);
143
144 bool TestSuite_iSExitCodeCheckingEnabled(TestCaseContext_t context);
145
146 errno_t TestSuite_changeDir(TestSuite_t testSuite);
147
148 void TestSuite_setCommandLine(TestSuite_t testSuite);
149
150
151 #ifdef __VERBOSE
152 /* 
153  * Update the current time. 
154  */
155 void TestSuite_update_current_time(TestSuite_t ptr);
156 #endif                          /* #ifdef __VERBOSE */
157
158
159
160 #endif                          /* #ifndef __TestSuite_H__ */