Added basic session test

This commit is contained in:
Moritz Lipp 2012-03-19 17:00:34 +01:00
parent c9de38d960
commit 0a0c712e17
3 changed files with 37 additions and 2 deletions

1
main.c
View file

@ -33,4 +33,3 @@ int main(int argc, char* argv[])
return 0; return 0;
} }

24
tests/test_session.c Normal file
View file

@ -0,0 +1,24 @@
/* See LICENSE file for license and copyright information */
#include <check.h>
#include "../zathura.h"
START_TEST(test_create) {
zathura_t* zathura = zathura_init(0, NULL);
fail_unless(zathura != NULL, "Could not create session");
zathura_free(zathura);
} END_TEST
Suite* suite_session()
{
TCase* tcase = NULL;
Suite* suite = suite_create("Session");
/* basic */
tcase = tcase_create("basic");
tcase_add_test(tcase, test_create);
suite_add_tcase(suite, tcase);
return suite;
}

View file

@ -3,14 +3,26 @@
#include <check.h> #include <check.h>
#include <stdlib.h> #include <stdlib.h>
Suite* suite_session();
Suite* suite_utils(); Suite* suite_utils();
int main() int
main(int argc, char* argv[])
{ {
Suite* suite = NULL; Suite* suite = NULL;
SRunner* suite_runner = NULL; SRunner* suite_runner = NULL;
int number_failed = 0; int number_failed = 0;
/* init gtk */
gtk_init(&argc, &argv);
/* test session */
suite = suite_session();
suite_runner = srunner_create(suite);
srunner_run_all(suite_runner, CK_NORMAL);
number_failed += srunner_ntests_failed(suite_runner);
srunner_free(suite_runner);
/* test utils */ /* test utils */
suite = suite_utils(); suite = suite_utils();
suite_runner = srunner_create(suite); suite_runner = srunner_create(suite);