tests.c 850 Bytes
Newer Older
1 2 3
/* See LICENSE file for license and copyright information */

#include <check.h>
4
#include <stdlib.h>
Sebastian Ramacher's avatar
Sebastian Ramacher committed
5
#include <gtk/gtk.h>
6

Moritz Lipp's avatar
Moritz Lipp committed
7
Suite* suite_session();
8 9
Suite* suite_utils();

Moritz Lipp's avatar
Moritz Lipp committed
10 11
int
main(int argc, char* argv[])
12 13 14
{
  Suite* suite          = NULL;
  SRunner* suite_runner = NULL;
15
  int number_failed = 0;
16

Moritz Lipp's avatar
Moritz Lipp committed
17 18 19 20 21 22 23 24 25 26
  /* 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);

27 28 29 30
  /* test utils */
  suite        = suite_utils();
  suite_runner = srunner_create(suite);
  srunner_run_all(suite_runner, CK_NORMAL);
31
  number_failed += srunner_ntests_failed(suite_runner);
32 33
  srunner_free(suite_runner);

34
  return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
35
}