mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 07:56:47 +01:00
Added basic session test
This commit is contained in:
parent
c9de38d960
commit
0a0c712e17
3 changed files with 37 additions and 2 deletions
1
main.c
1
main.c
|
@ -33,4 +33,3 @@ int main(int argc, char* argv[])
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
24
tests/test_session.c
Normal file
24
tests/test_session.c
Normal 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;
|
||||
}
|
|
@ -3,14 +3,26 @@
|
|||
#include <check.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
Suite* suite_session();
|
||||
Suite* suite_utils();
|
||||
|
||||
int main()
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
{
|
||||
Suite* suite = NULL;
|
||||
SRunner* suite_runner = NULL;
|
||||
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 */
|
||||
suite = suite_utils();
|
||||
suite_runner = srunner_create(suite);
|
||||
|
|
Loading…
Reference in a new issue