Add support for 'make check' and a dummy test.
authorLinus Nordberg <linus@nordu.net>
Tue, 27 Sep 2011 08:18:21 +0000 (10:18 +0200)
committerLinus Nordberg <linus@nordu.net>
Tue, 27 Sep 2011 08:18:21 +0000 (10:18 +0200)
Makefile.am
configure.ac
tests/Makefile.am [new file with mode: 0644]
tests/t_fticks.c [new file with mode: 0644]

index 2b51fc7..10fe5f4 100644 (file)
@@ -1,5 +1,7 @@
 AUTOMAKE_OPTIONS = foreign
 
+SUBDIRS = tests
+
 sbin_PROGRAMS = radsecproxy
 bin_PROGRAMS = catgconf
 noinst_LIBRARIES = librsp.a
index 25db07c..24cbf05 100644 (file)
@@ -92,4 +92,7 @@ AM_CONDITIONAL(HAVE_DOCBOOK2X_MAN, test "$DOCBOOK2X_MAN" = "yes")
 AC_SUBST(TARGET_CFLAGS)
 AC_SUBST(TARGET_LDFLAGS)
 AX_CHECK_SSL
-AC_OUTPUT(Makefile)
+AC_OUTPUT([
+       Makefile
+       tests/Makefile
+])
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644 (file)
index 0000000..9c0ce94
--- /dev/null
@@ -0,0 +1,7 @@
+check_PROGRAMS = t_fticks
+
+AM_CFLAGS = -g -Wall -Werror @TARGET_CFLAGS@
+AM_LDFLAGS = @SSL_LDFLAGS@ @TARGET_LDFLAGS@
+LDADD = $(top_builddir)/librsp.a @SSL_LIBS@
+
+TESTS = $(check_PROGRAMS)
diff --git a/tests/t_fticks.c b/tests/t_fticks.c
new file mode 100644 (file)
index 0000000..71a015e
--- /dev/null
@@ -0,0 +1,11 @@
+#include "../radsecproxy.h"
+#include "../fticks.h"
+
+int
+main (int argc, char *argv[])
+{
+  uint8_t buf[128];
+
+  fticks_hashmac((const uint8_t *) "xyzzy", NULL, sizeof(buf), buf);
+  return 0;
+}