Skip to contentSkip to conversation

fallback 'unit-test' target for those who don't have ruby installed

PATCH New Joe Thornber 1 participant 1 message Mar 29, 2011 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fallback 'unit-test' target for those who don't have ruby installed

commit 79bb0560381791c3d90cbcfcf89a0f61da2f15e1

Author: Joe Thornber <[email protected]>
Date:   Tue Mar 29 12:44:36 2011 +0100

o Change the --enable-testing configure option to
--enable-ruby-testing
o Add fallback 'make unit-test' implementation using bash

Makefile.in +8 -5
index f7e34f4..b0e5511 100644
@@ -131,11 +131,8 @@ endif
 
 endif
 
-ifeq ("$(TESTING)", "yes")
-# testing and report generation
-RUBY=ruby1.9 -Ireport-generators/lib -Ireport-generators/test
-
-.PHONEY: unit-test ruby-test test-programs
+# testing targets
+.PHONEY: unit-test test-programs memcheck
 
 # FIXME: put dependencies on libdm and liblvm
 test-programs:
@@ -143,6 +140,9 @@ test-programs:
 	cd unit-tests/datastruct && $(MAKE)
 	cd unit-tests/mm && $(MAKE)
 
+ifeq ("$(RUBY_TESTING)", "yes")
+RUBY=ruby1.9 -Ireport-generators/lib -Ireport-generators/test
+
 unit-test: test-programs
 	$(RUBY) report-generators/unit_test.rb $(shell find . -name TESTS)
 	$(RUBY) report-generators/title_page.rb
@@ -153,4 +153,7 @@ memcheck: test-programs
 
 ruby-test:
 	$(RUBY) report-generators/test/ts.rb
+else
+unit-test: test-programs
+	scripts/unit-test $(shell find . -name TESTS)
 endif
configure.in +0 -0
index c531c8a..91626f6 100644
@@ -754,12 +754,12 @@ fi
 

################################################################################
dnl -- Enable testing
AC_MSG_CHECKING(whether to enable unit testing)
-AC_ARG_ENABLE(testing,
- AC_HELP_STRING(--enable-testing, [enable testing targets
in the makefile]),
- TESTING=$enableval, TESTING=no)
-AC_MSG_RESULT($TESTING)
+AC_ARG_ENABLE(ruby-testing,
+ AC_HELP_STRING(--enable-ruby-testing, [enable ruby
testing framework]),
+ RUBY_TESTING=$enableval, RUBY_TESTING=no)
+AC_MSG_RESULT($RUBY_TESTING)

-if test "$TESTING" = yes; then
+if test "$RUBY_TESTING" = yes; then

    AC_PATH_PROG(RUBY19, ruby1.9)
    AC_PATH_PROG(VALGRIND, valgrind)
    if test -z "$RUBY19" -o -z "$VALGRIND"; then

@@ -1363,7 +1363,7 @@ AC_SUBST(SELINUX_PC)
AC_SUBST(SNAPSHOTS)
AC_SUBST(STATICDIR)
AC_SUBST(STATIC_LINK)
-AC_SUBST(TESTING)
+AC_SUBST(RUBY_TESTING)
AC_SUBST(UDEV_LIBS)
AC_SUBST(UDEV_PC)
AC_SUBST(UDEV_RULES)

make.tmpl.in +1 -1
index 5380b5e..0bdcd48 100644
@@ -44,7 +44,7 @@ PTHREAD_LIBS = @PTHREAD_LIBS@
 READLINE_LIBS = @READLINE_LIBS@
 SELINUX_LIBS = @SELINUX_LIBS@
 UDEV_LIBS = @UDEV_LIBS@
-TESTING = @TESTING@
+RUBY_TESTING = @RUBY_TESTING@
 
 # Setup directory variables
 prefix = @prefix@
scripts/unit-test new file +58 -0

59 lines not on this page · raw message