3 * Definitions for testing
5 * (c) 2023 Mark Wooding
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of the `Finally' package.
12 * Finally is free software: you can redistribute it and/or modify it
13 * under the terms of the GNU Library General Public License as published
14 * by the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * Finally is distributed in the hope that it will be useful, but WITHOUT
18 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20 * License for more details.
22 * You should have received a copy of the GNU Library General Public
23 * License along with Finally. If not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
28 #ifndef FINALLY_TEST_H
29 #define FINALLY_TEST_H
35 /*----- Utility macros ----------------------------------------------------*/
37 #define STR(x) STR1(x)
39 #define WHERE __FILE__ ":" STR(__LINE__)
41 /*----- Strange hacks -----------------------------------------------------*/
43 extern const int secretly_true;
45 /*----- Functions provided ------------------------------------------------*/
47 #define STEP(s) check_step(s, WHERE)
48 #define MISSTEP STEP(-1)
50 extern void init_test(void);
51 extern void begin_test(const char *name);
52 extern void check_step(int s, const char *where);
53 extern void end_test(void);
54 extern void skip_test(const char *name, const char *excuse);
55 extern int test_report(void);
57 #if defined(HAVE_FEXCEPTIONS)
59 extern void try_catch_outer(unsigned f);
60 extern void try_catch_filling(unsigned f);
61 extern void try_catch_inner(unsigned f);
64 /*----- That's all, folks -------------------------------------------------*/