[Opensrf-commits] r2240 - in branches/rel_2_0: . src/extras (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Sun May 8 11:39:00 EDT 2011


Author: dbs
Date: 2011-05-08 11:38:58 -0400 (Sun, 08 May 2011)
New Revision: 2240

Added:
   branches/rel_2_0/tests/
Modified:
   branches/rel_2_0/Makefile.am
   branches/rel_2_0/configure.ac
   branches/rel_2_0/src/extras/Makefile.install
Log:
Add a C unit testing framework and tests for OpenSRF

The unit testing framework is "Check" - http://check.sourceforge.net/

These tests can be executed by running 'make check' after you
configure and compile the OpenSRF code.

To run them, you must have the 'check' package installed.

Author: Kevin Beswick <kevinbeswick00 at gmail.com>
Signed-off-by: Dan Scott <dan at coffeecode.net>
Signed-off-by: Kevin Beswick <kevinbeswick00 at gmail.com>


Modified: branches/rel_2_0/Makefile.am
===================================================================
--- branches/rel_2_0/Makefile.am	2011-05-08 15:38:31 UTC (rev 2239)
+++ branches/rel_2_0/Makefile.am	2011-05-08 15:38:58 UTC (rev 2240)
@@ -115,7 +115,7 @@
 	src/gateway/apachetools.h
 endif
 
-SUBDIRS = src
+SUBDIRS = src tests
 
 jserver:
 	make -s -C src jserver

Modified: branches/rel_2_0/configure.ac
===================================================================
--- branches/rel_2_0/configure.ac	2011-05-08 15:38:31 UTC (rev 2239)
+++ branches/rel_2_0/configure.ac	2011-05-08 15:38:58 UTC (rev 2240)
@@ -294,6 +294,15 @@
 	AC_SUBST(memcached_CFLAGS)
 	AC_SUBST(memcached_LIBS)
 
+    # Check Unit test framework
+    PKG_CHECK_MODULES([CHECK], [check >= 0.9.0], [enable_tests=yes],
+                      [enable_tests=no])
+    AM_CONDITIONAL(CHECK_TESTS, test x$enable_tests = xyes)
+
+    if test "x$enable_tests" = "xno"; then
+      AC_MSG_WARN(Check unit testing framwork not found.)
+    fi
+
 	#-----------------------------
 	# Checks for header files.
 	#-----------------------------
@@ -312,6 +321,7 @@
 	AC_TYPE_SIZE_T
 	AC_HEADER_TIME
 	AC_STRUCT_TM
+    AM_PROG_CC_C_O
 
 	#----------------------------------
 	# Checks for library functions.
@@ -343,6 +353,7 @@
 			 src/python/opensrf.py
 			 src/router/Makefile
 			 src/srfsh/Makefile
+             tests/Makefile
 			 bin/opensrf-perl.pl
 			 bin/osrf_config
 			 bin/osrf_ctl.sh])

Modified: branches/rel_2_0/src/extras/Makefile.install
===================================================================
--- branches/rel_2_0/src/extras/Makefile.install	2011-05-08 15:38:31 UTC (rev 2239)
+++ branches/rel_2_0/src/extras/Makefile.install	2011-05-08 15:38:58 UTC (rev 2240)
@@ -81,6 +81,7 @@
 	autoconf\
 	automake\
 	build-essential\
+	check\
 	ejabberd\
 	less\
 	libapache2-mod-perl2\

Copied: branches/rel_2_0/tests (from rev 2237, trunk/tests)



More information about the opensrf-commits mailing list