all: $(TARGETS)
+tests/check: tests/check.o tests/ptb.o tests/gp.o
+ $(CC) $(FLAGS) $^ -o $@ $(CHECK_LIBS)
+
ptb2xml.o: ptb2xml.c
$(CC) $(CFLAGS) -c $< $(LIBXSLT_CFLAGS) $(LIBXML_CFLAGS) $(XSLT_DEFINE)
%.o: %.c
- $(CC) $(CFLAGS) -c $<
+ $(CC) $(CFLAGS) -c $< -o $@
%.po: %.c
$(CC) $(CFLAGS) -fPIC -c $< -o $@
tags: $(wildcard *.c) $(wildcard *.h)
ctags *.c *.h
-check::
+check:: tests/check
+ ./tests/check
configure: configure.in
autoreconf -f
clean:
rm -f *.o core $(TARGETS) *.po
+ rm -f tests/check tests/*.o
distclean: clean
rm -f Makefile.settings config.h config.log
--- /dev/null
+/*
+ testsuite for ptabtools
+ (c) 2007 Jelmer Vernooij <jelmer@samba.org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <check.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+Suite *ptb_suite();
+Suite *gp_suite();
+
+int main (int argc, char **argv)
+{
+ int nf;
+ SRunner *sr;
+
+ sr = srunner_create(ptb_suite());
+ srunner_add_suite(sr, gp_suite());
+ srunner_run_all (sr, CK_NORMAL);
+ nf = srunner_ntests_failed(sr);
+ srunner_free(sr);
+
+ return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}
--- /dev/null
+/*
+ testsuite for ptabtools
+ (c) 2007 Jelmer Vernooij <jelmer@samba.org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <check.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+START_TEST(test_get_step)
+END_TEST
+
+Suite *gp_suite()
+{
+ Suite *s = suite_create("gp");
+ TCase *tc_core = tcase_create("core");
+ suite_add_tcase(s, tc_core);
+ tcase_add_test(tc_core, test_get_step);
+ return s;
+}
--- /dev/null
+/*
+ testsuite for ptabtools
+ (c) 2007 Jelmer Vernooij <jelmer@samba.org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include <check.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+START_TEST(test_get_step)
+END_TEST
+
+Suite *ptb_suite()
+{
+ Suite *s = suite_create("ptb");
+ TCase *tc_core = tcase_create("core");
+ suite_add_tcase(s, tc_core);
+ tcase_add_test(tc_core, test_get_step);
+ return s;
+}