zathura/tests/tests.c

37 lines
762 B
C
Raw Normal View History

2018-11-27 23:10:18 +01:00
/* SPDX-License-Identifier: Zlib */
2012-01-28 19:54:10 +01:00
2012-03-19 20:09:11 +01:00
#include <gtk/gtk.h>
#include <stdlib.h>
2012-01-28 19:54:10 +01:00
#include "tests.h"
2012-03-30 16:43:00 +02:00
int run_suite(Suite* suite)
{
SRunner* suite_runner = srunner_create(suite);
srunner_run_all(suite_runner, CK_NORMAL);
const int number_failed = srunner_ntests_failed(suite_runner);
int ret = EXIT_SUCCESS;
if (number_failed != 0) {
ret = EXIT_FAILURE;
TestResult** results = srunner_failures(suite_runner);
2018-05-21 11:59:54 +02:00
for (int i = 0; i < number_failed; ++i) {
if (tr_ctx(results[i]) == CK_CTX_SETUP) {
/* mark tests as skipped */
ret = 77;
break;
}
}
}
2012-03-30 16:43:00 +02:00
srunner_free(suite_runner);
2012-03-30 16:43:00 +02:00
return ret;
}
2012-01-28 19:54:10 +01:00
void setup(void)
2012-01-28 19:54:10 +01:00
{
2021-09-20 00:04:58 +02:00
ck_assert_msg(gtk_init_check(NULL, NULL) == TRUE, "GTK+ initializitation failed");
2012-01-28 19:54:10 +01:00
}