mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 15:53:45 +01:00
Added basic session test
This commit is contained in:
parent
c9de38d960
commit
0a0c712e17
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 New Issue
Block a user