summaryrefslogtreecommitdiffstats
path: root/tests/foodtest.in
blob: 8d45f26cbc0724fd25cb45e9655db2802d9638da (plain) (blame)
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
/* -*- mode: c -*- */
#include <check.h>

/*
 * Source files check by this suite:
 */
#include "../src/parser.c"
#include "../src/types.c"
#include "../src/util.c"

#define is1(arg) ck_assert_int_eq(arg, 1)
#define is0(arg) ck_assert_int_eq(arg, 0)


/*
 * Test suite based on check
 *
 * To add a new case simply create the <case>.c file
 * in the tests/ directory and include it below
 * Also add the new file to the EXTRA_DIST files in
 * tests/Makefile.am
 *
 * To add a new test go to the appropriate case file
 * and add it there
 */
#include "types.c"
#include "util.c"
#include "parser.c"

Suite * foodtest_suite(void)
{
    Suite *s;

    s = suite_create("foodtools tests");

    /*** maketests.sh begin ***/
    /* everything in here will be replaced upon building */
    /* DO NOT delete the begin/end lines */
    /*** maketests.sh end ***/

    return s;
}

int main(void)
{
    int number_failed;
    Suite *s;
    SRunner *sr;

    s = foodtest_suite();
    sr = srunner_create(s);
    srunner_set_tap(sr, "-");
    srunner_run_all(sr, CK_NORMAL);
    number_failed = srunner_ntests_failed(sr);
    srunner_free(sr);
    return (number_failed == 0) ? 0 : CK_FAILURE;
}