diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-25 14:17:39 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-06-25 14:17:39 +0200 |
commit | 125b35db3243f55489a6e88efbdeeefc2c24018d (patch) | |
tree | 1e24ec316678b6af288ed96d29e82bbba37f70bc /tests/check.c | |
parent | 59f5c42a86fe73e95aaed0bfe455c7c816f39d2b (diff) | |
parent | 1fc2958b1e503b782081692c1a503bc7bba19fe1 (diff) |
Merging from Jelmer (this adds some basic unit testing code).
Diffstat (limited to 'tests/check.c')
-rw-r--r-- | tests/check.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/check.c b/tests/check.c new file mode 100644 index 00000000..5cfb7dfd --- /dev/null +++ b/tests/check.c @@ -0,0 +1,32 @@ +#include <stdlib.h> +#include <glib.h> +#include <gmodule.h> +#include <check.h> +#include "bitlbee.h" + +global_t global; /* Against global namespace pollution */ + +double gettime() +{ + struct timeval time[1]; + + gettimeofday( time, 0 ); + return( (double) time->tv_sec + (double) time->tv_usec / 1000000 ); +} + +/* From check_util.c */ +Suite *util_suite(void); + +/* From check_nick.c */ +Suite *nick_suite(void); + +int main (void) +{ + int nf; + SRunner *sr = srunner_create(util_suite()); + srunner_add_suite(sr, nick_suite()); + srunner_run_all (sr, CK_NORMAL); + nf = srunner_ntests_failed(sr); + srunner_free(sr); + return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE; +} |