# Process this file with automake to generate Makefile.in
#-----------------------------------------------------------
+SUBDIRS = tests
+
AM_CFLAGS = $(DEF_CFLAGS) -DOSRF_LOG_PARAMS -I@top_srcdir@/include/
AM_LDFLAGS = $(DEF_LDFLAGS) -L$(DBI_LIBS) -lopensrf
--- /dev/null
+export DEF_LDFLAGS = -L. -L$(TMP) -L$(OPENSRF_LIBS)
+export DEF_CFLAGS = -D_LARGEFILE64_SOURCE -pipe -g -Wall -O2 -fPIC -I@top_srcdir@/include -I$(LIBXML2_HEADERS) -I$(APACHE2_HEADERS) -I$(APR_HEADERS) -I$(LIBXML2_HEADERS)/libxml -I$(TMP) -I$(OPENSRF_HEADERS)
+export DEF_LDLIBS = -lopensrf
+
+COMMON = testsuite.c
+AM_CFLAGS = $(DEF_CFLAGS) -DOSRF_LOG_PARAMS
+AM_LDFLAGS = $(DEF_LDLIBS) -L$(DBI_LIBS)
+
+TESTS = check_util check_idl
+check_PROGRAMS = check_util check_idl
+
+check_util_SOURCES = $(COMMON) check_util.c
+check_util_CFLAGS = $(AM_CFLAGS)
+check_util_LDFLAGS = $(AM_LDFLAGS) -loils_idl -loils_utils -lcheck
+check_util_DEPENDENCIES = ../liboils_idl.la ../liboils_utils.la
+
+check_idl_SOURCES = $(COMMON) check_idl.c
+check_idl_CFLAGS = $(AM_CFLAGS)
+check_idl_LDFLAGS = $(AM_LDFLAGS) -loils_idl -loils_utils -lcheck
+check_idl_DEPENDENCIES = ../liboils_idl.la ../liboils_utils.la
+
--- /dev/null
+#include <check.h>
+#include <ctype.h>
+#include <limits.h>
+#include "openils/oils_utils.h"
+#include "openils/oils_idl.h"
+
+osrfHash * my_idl;
+
+//Set up the test fixture
+void setup (void) {
+ my_idl = oilsInitIDL("../../../examples/fm_IDL.xml");
+}
+
+//Clean up the test fixture
+void teardown (void) {
+ free(my_idl);
+}
+
+//Tests
+
+START_TEST (test_loading_idl)
+{
+ ck_assert(my_idl);
+}
+END_TEST
+
+//END Tests
+
+Suite *idl_suite (void) {
+ //Create test suite, test case, initialize fixture
+ Suite *s = suite_create("idl");
+ TCase *tc_core = tcase_create("Core");
+ tcase_add_checked_fixture(tc_core, setup, teardown);
+
+ //Add tests to test case
+ tcase_add_test(tc_core, test_loading_idl);
+
+ //Add test case to test suite
+ suite_add_tcase(s, tc_core);
+
+ return s;
+}
+
+void run_tests (SRunner *sr) {
+ srunner_add_suite (sr, idl_suite());
+}
--- /dev/null
+#include <check.h>
+#include <ctype.h>
+#include <limits.h>
+#include "openils/oils_utils.h"
+#include "openils/oils_idl.h"
+
+//Set up the test fixture
+void setup (void) {
+}
+
+//Clean up the test fixture
+void teardown (void) {
+}
+
+//Tests
+
+START_TEST (test_oilsUtilsIsDBTrue)
+{
+ ck_assert_msg( ! oilsUtilsIsDBTrue("0"), "oilsUtilIsDBTrue() should be false when passed '0'");
+ ck_assert_msg( oilsUtilsIsDBTrue("1"), "oilsUtilIsDBTrue() should be true when passed '1'");
+ ck_assert_msg( oilsUtilsIsDBTrue("-1"), "oilsUtilIsDBTrue() should be true when passed '-1'");
+ ck_assert_msg( oilsUtilsIsDBTrue("a"), "oilsUtilIsDBTrue() should be true when passed 'a'");
+ ck_assert_msg( ! oilsUtilsIsDBTrue("f"), "oilsUtilIsDBTrue() should be false when passed 'f'");
+}
+END_TEST
+
+//END Tests
+
+Suite *util_suite (void) {
+ //Create test suite, test case, initialize fixture
+ Suite *s = suite_create("util");
+ TCase *tc_core = tcase_create("Core");
+ tcase_add_checked_fixture(tc_core, setup, teardown);
+
+ //Add tests to test case
+ tcase_add_test(tc_core, test_oilsUtilsIsDBTrue);
+
+ //Add test case to test suite
+ suite_add_tcase(s, tc_core);
+
+ return s;
+}
+
+void run_tests (SRunner *sr) {
+ srunner_add_suite (sr, util_suite());
+}
--- /dev/null
+#include <stdlib.h>
+#include <check.h>
+#include "testsuite.h"
+
+extern void run_tests(SRunner *sr);
+
+int main (int argc, char **argv)
+{
+ SRunner *sr = srunner_create(NULL);
+ run_tests(sr);
+ srunner_run_all(sr, CK_NORMAL);
+ int failed = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
--- /dev/null
+#ifndef __OPENSRF_CHECK_H__
+#define __OPENSRF_CHECK_H__
+
+#endif /* __OPENSRF_CHECK_H__ */
AC_CONFIG_FILES([Open-ILS/examples/Makefile
Open-ILS/src/c-apps/Makefile
+ Open-ILS/src/c-apps/tests/Makefile
Open-ILS/src/extras/Makefile
Open-ILS/src/java/Makefile
Open-ILS/src/python/Makefile])