File: testmain.c

package info (click to toggle)
netsurf 3.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 51,332 kB
  • ctags: 27,027
  • sloc: ansic: 279,666; xml: 81,901; objc: 8,341; cpp: 5,716; perl: 4,127; makefile: 1,894; yacc: 1,509; jsp: 1,156; sh: 895; lex: 479; asm: 288; python: 121; php: 6
file content (43 lines) | stat: -rw-r--r-- 953 bytes parent folder | download | duplicates (2)
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
/* test/testmain.c
 *
 * Core of the test suite for libwapcaplet
 *
 * Copyright 2009 The NetSurf Browser Project
 *                Daniel Silverstone <dsilvers@netsurf-browser.org>
 */

#include <check.h>
#include <stdlib.h>

#include "tests.h"

#ifndef UNUSED
#define UNUSED(x) ((x) = (x))
#endif

/* This means that assertion failures are silent in tests */
extern void __assert_fail(void);
void __assert_fail(void) { abort(); }

int
main(int argc, char **argv)
{
        int number_failed = 0;
        SRunner *sr;

	UNUSED(argc);
	UNUSED(argv);
  
        sr = srunner_create(suite_create("Test suite for libwapcaplet"));
        
        lwc_basic_suite(sr);
//        lwc_memory_suite(sr);
        
        srunner_set_fork_status(sr, CK_FORK);
        srunner_run_all(sr, CK_ENV);
        number_failed = srunner_ntests_failed(sr);
        
        srunner_free(sr);
        
        return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}