]> git.donarmstrong.com Git - lilypond.git/blob - guile18/test-suite/tests/c-api/testlib.h
Import guile-1.8 as multiple upstream tarball component
[lilypond.git] / guile18 / test-suite / tests / c-api / testlib.h
1 /* testlib.h --- reporting test results
2    Jim Blandy <jimb@red-bean.com> --- August 1999 */
3
4 #ifndef TESTLIB_H
5 #define TESTLIB_H
6
7 extern void test_pass (char *name);
8 extern void test_fail (char *name);
9 extern void test_pass_if (char *name, int condition);
10
11 /* We need a way to keep track of what groups of tests we're currently
12    within.  A call to test_enter_context assures that future tests
13    will be reported with a name prefixed by NAME, until we call
14    test_restore_context with the value it returned.
15
16    Calls to test_enter_context and test_restore_context should be
17    properly nested; passing the context around allows them to detect
18    mismatches.
19
20    It is the caller's responsibility to free NAME after exiting the
21    context.  (This is trivial if you're passing string literals to
22    test_enter_context.)  */
23
24 typedef int test_context_t;
25 extern test_context_t test_enter_context (char *name);
26 extern void test_restore_context (test_context_t context);
27
28 #endif /* TESTLIB_H */