19866378 Can enable gmake check in libdnet when check is checked in
authorRich Burridge <rich.burridge@oracle.com>
Thu, 14 May 2015 09:33:42 -0700
changeset 4291 402cc6853ea3
parent 4289 a8f2d3273985
child 4292 b567a8854fea
19866378 Can enable gmake check in libdnet when check is checked in
components/libdnet/Makefile
components/libdnet/patches/configure.in.patch
components/libdnet/test/results-all.master
--- a/components/libdnet/Makefile	Wed May 13 18:56:30 2015 -0700
+++ b/components/libdnet/Makefile	Thu May 14 09:33:42 2015 -0700
@@ -52,25 +52,30 @@
 # Remove Linux specific functionality.
 CONFIGURE_OPTIONS += ac_cv_dnet_linux_pf_packet=no
 
-# Uncomment if you have the Check unit testing framework installed.
-#CONFIGURE_OPTIONS +=	--with-check=/usr
+CONFIGURE_OPTIONS +=	--with-check=/usr
+
+# Needed for "gmake test" to work successfully.
+# If SHELLOPTS is exported (as it is by the userland makefiles),
+# then all shell options get exported to child invocations of bash,
+# which results in test failures due to nounset and xtrace being
+# set unexpectedly, and errors such as "$1: unbound variable" and
+# diffs failing due to script tracing in output files.
+unexport SHELLOPTS
+
+COMPONENT_TEST_DIR =	$(@D)/test/check
+
+COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
 
 ASLR_MODE = $(ASLR_ENABLE)
 
-# common targets
 configure:	$(CONFIGURE_32_and_64)
 
 build:		$(BUILD_32_and_64)
 
 install:	$(INSTALL_32_and_64)
 
-# Tests for libdnet are not enabled by default as they use the Check unit
-# testing framework which is currently not present on Solaris. See:
-# http://check.sourceforge.net/ for more details.
-# If you do have Check on your system, then uncomment the TEST_32 line.
-test:		$(NO_TESTS)
-#test:		$(TEST_32_and_64)
+test:		$(TEST_32_and_64)
 
-
+REQUIRED_PACKAGES += developer/test/check
 REQUIRED_PACKAGES += shell/ksh93
 REQUIRED_PACKAGES += system/library
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libdnet/patches/configure.in.patch	Thu May 14 09:33:42 2015 -0700
@@ -0,0 +1,34 @@
+Adjust the check for the check test framework to look for libcheck.so
+instead of libcheck.a.
+
+This change will be sent upstream.
+
+--- libdnet-1.12/configure.in.orig	2015-05-07 08:14:49.583718066 -0700
++++ libdnet-1.12/configure.in	2015-05-07 08:17:24.526491068 -0700
[email protected]@ -131,22 +131,22 @@
+      ;;
+   *)
+      AC_MSG_RESULT($withval)
+-     if test -f $withval/include/check.h -a -f $withval/lib/libcheck.a; then
++     if test -f $withval/include/check.h -a -f $withval/lib/libcheck.so; then
+         owd=`pwd`
+         if cd $withval; then withval=`pwd`; cd $owd; fi
+         CHECKINC="-I$withval/include"
+         CHECKLIB="-L$withval/lib -lcheck"
+-     elif test -f $withval/src/check.h -a -f $withval/src/libcheck.a; then
++     elif test -f $withval/src/check.h -a -f $withval/src/libcheck.so; then
+         owd=`pwd`
+         if cd $withval; then withval=`pwd`; cd $owd; fi
+         CHECKINC="-I$withval/src"
+         CHECKLIB="-L$withval/src -lcheck"
+      else
+-        AC_ERROR(check.h or libcheck.a not found in $withval)
++        AC_ERROR(check.h or libcheck.so not found in $withval)
+      fi
+      ;;
+   esac ],
+-[ if test -f ${prefix}/include/check.h -a -f ${prefix}/lib/libcheck.a; then
++[ if test -f ${prefix}/include/check.h -a -f ${prefix}/lib/libcheck.so; then
+      CHECKINC="-I${prefix}/include"
+      CHECKLIB="-L${prefix}/lib -lcheck"
+      AC_MSG_RESULT(yes)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libdnet/test/results-all.master	Thu May 14 09:33:42 2015 -0700
@@ -0,0 +1,32 @@
+make[1]: Entering directory `$(@D)/test/check'
+/usr/gnu/bin/make  check-TESTS
+make[2]: Entering directory `$(@D)/test/check'
+make[3]: Entering directory `$(@D)/test/check'
+FAIL: check_addr
+FAIL: check_arp
+PASS: check_blob
+PASS: check_eth
+FAIL: check_fw
+FAIL: check_ip
+PASS: check_intf
+PASS: check_rand
+FAIL: check_route
+============================================================================
+Testsuite summary for 
+============================================================================
+# TOTAL: 9
+# PASS:  4
+# SKIP:  0
+# XFAIL: 0
+# FAIL:  5
+# XPASS: 0
+# ERROR: 0
+============================================================================
+See test/check/test-suite.log
+============================================================================
+make[3]: *** [test-suite.log] Error 1
+make[3]: Leaving directory `$(@D)/test/check'
+make[2]: *** [check-TESTS] Error 2
+make[2]: Leaving directory `$(@D)/test/check'
+make[1]: *** [check-am] Error 2
+make[1]: Leaving directory `$(@D)/test/check'