Debian Codegraph @

inc/core/AgnUnitTest.h

raw
1 /**
2
3 Copyright (c) 2010-2014, Daniel S. Standage and CONTRIBUTORS
4
5 The AEGeAn Toolkit is distributed under the ISC License. See
6 the 'LICENSE' file in the AEGeAn source code distribution or
7 online at https://github.com/standage/AEGeAn/blob/master/LICENSE.
8
9 **/
10 #ifndef AEGEAN_UNIT_TEST
11 #define AEGEAN_UNIT_TEST
12
13 #include "genometools.h"
14
15 /**
16 * @class AgnUnitTest
17 * Class used for unit testing of classes and modules.
18 */
19 typedef struct AgnUnitTest AgnUnitTest;
20
21 /**
22 * @function Destructor.
23 */
24 void agn_unit_test_delete(AgnUnitTest *test);
25
26 /**
27 * @function Class constructor, where ``label`` is a label for the test and
28 * ``testfunc`` is a pointer to the function that will execute the test.
29 */
30 AgnUnitTest *agn_unit_test_new(const char *label,
31 bool (*testfunc)(AgnUnitTest *));
32
33 /**
34 * @function Prints results of the unit test to ``outstream``.
35 */
36 void agn_unit_test_print(AgnUnitTest *test, FILE *outstream);
37
38 /**
39 * @function Add a result to this unit test.
40 */
41 void agn_unit_test_result(AgnUnitTest *test, const char *label, bool success);
42
43 /**
44 * @function Returns true if all the results checked with this unit test passed,
45 * false otherwise.
46 */
47 bool agn_unit_test_success(AgnUnitTest *test);
48
49 /**
50 * @function Run the unit test.
51 */
52 void agn_unit_test_run(AgnUnitTest *test);
53
54 #endif