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

#include <check.h>
4
#include <stdlib.h>
5

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

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

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

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

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