[med-svn] r16535 - in trunk/packages/camitk/trunk/debian: . tests

Emmanuel Promayon promayon-guest at moszumanska.debian.org
Fri Mar 28 11:35:19 UTC 2014


Author: promayon-guest
Date: 2014-03-28 11:35:19 +0000 (Fri, 28 Mar 2014)
New Revision: 16535

Added:
   trunk/packages/camitk/trunk/debian/tests/
   trunk/packages/camitk/trunk/debian/tests/config
   trunk/packages/camitk/trunk/debian/tests/control
Modified:
   trunk/packages/camitk/trunk/debian/changelog
   trunk/packages/camitk/trunk/debian/control
   trunk/packages/camitk/trunk/debian/libcamitk3-dev.lintian-overrides
   trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides
   trunk/packages/camitk/trunk/debian/rules
Log:
New upstream release (re-enabling some plugins unit tests from the package test suite + adding a fist test to autopkgtest)


Modified: trunk/packages/camitk/trunk/debian/changelog
===================================================================
--- trunk/packages/camitk/trunk/debian/changelog	2014-03-28 01:56:11 UTC (rev 16534)
+++ trunk/packages/camitk/trunk/debian/changelog	2014-03-28 11:35:19 UTC (rev 16535)
@@ -4,8 +4,11 @@
   * Patches:
     - avoid console redirection (config-console-redirection.diff)
     - missing manpages, desktop and icon (applications-man-pixmap-desktop.diff)
+  * Added some package tests
+  * Added some debian/tests files for autopkgtest
+  * New dicom components now directly based on gdcm 
 
- -- Emmanuel Promayon <Emmanuel.Promayon at imag.fr>  Tue, 18 Mar 2014 11:43:34 +0100
+ -- Emmanuel Promayon <Emmanuel.Promayon at imag.fr>  Tue, 28 Mar 2014 09:13:44 +0100
 
 camitk (3.2.2-2) unstable; urgency=medium
 

Modified: trunk/packages/camitk/trunk/debian/control
===================================================================
--- trunk/packages/camitk/trunk/debian/control	2014-03-28 01:56:11 UTC (rev 16534)
+++ trunk/packages/camitk/trunk/debian/control	2014-03-28 11:35:19 UTC (rev 16535)
@@ -17,7 +17,9 @@
                libfftw3-dev,
                libqtwebkit-dev | libqt4-dev (<< 4.7),
                libvtkgdcm2-dev,
-               libqt4-opengl-dev
+               libqt4-opengl-dev,
+               xvfb,
+               xauth
 Build-Depends-Indep: doxygen,
                      graphviz
 Standards-Version: 3.9.5
@@ -25,6 +27,7 @@
 Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/camitk/trunk/
 Homepage: http://camitk.imag.fr/
 X-Homepage: https://forge.imag.fr/projects/camitk/
+XS-Testsuite: autopkgtest
 
 Package: libcamitk3
 Architecture: any

Modified: trunk/packages/camitk/trunk/debian/libcamitk3-dev.lintian-overrides
===================================================================
--- trunk/packages/camitk/trunk/debian/libcamitk3-dev.lintian-overrides	2014-03-28 01:56:11 UTC (rev 16534)
+++ trunk/packages/camitk/trunk/debian/libcamitk3-dev.lintian-overrides	2014-03-28 11:35:19 UTC (rev 16535)
@@ -4,3 +4,6 @@
 # memmove and memcpy 
 # [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673112
 libcamitk3-dev: hardening-no-fortify-functions usr/bin/camitk-wizard
+# same for camitk-cepgenerator, hardening-check --verbose reports
+# only unprotected on memmove and memcpy
+libcamitk3-dev: hardening-no-fortify-functions usr/bin/camitk-cepgenerator

Modified: trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides
===================================================================
--- trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides	2014-03-28 01:56:11 UTC (rev 16534)
+++ trunk/packages/camitk/trunk/debian/libcamitk3.lintian-overrides	2014-03-28 11:35:19 UTC (rev 16535)
@@ -4,19 +4,17 @@
 # is "libcamitkcore3"
 # but the package is called libcamitk3 (which is more than just the corelib)
 libcamitk3: package-name-doesnt-match-sonames libcamitkcore3
-
-# not needed anymore with version 3.3.0
 # W overrides for hardening-no-fortify-functions because of false positives [1]
 # To verify this is only false positives, I used hardening-check --verbose on all the 
 # on all reported binaries. They are all about: memmove and memcpy (apart from libitkfilters.so
 # which adds a memset as well)
 # [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=673112
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/actions/libbasicmesh.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/actions/libitkfilters.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/actions/libitksegmentation.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/actions/libmml.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/components/libdicom.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/components/libitkimage.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/components/libmml.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/components/libphysicalmodel.so.3.2.0
-#libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.2/libmonitoring.so.3.2.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/actions/libbasicmesh.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/actions/libitkfilters.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/actions/libitksegmentation.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/actions/libmeshprocessing.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/actions/libmml.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/components/libitkimage.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/components/libmml.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/components/libphysicalmodel.so.3.3.0
+libcamitk3: hardening-no-fortify-functions usr/lib/camitk-3.3/libmonitoring.so.3.3.0

Modified: trunk/packages/camitk/trunk/debian/rules
===================================================================
--- trunk/packages/camitk/trunk/debian/rules	2014-03-28 01:56:11 UTC (rev 16534)
+++ trunk/packages/camitk/trunk/debian/rules	2014-03-28 11:35:19 UTC (rev 16535)
@@ -4,12 +4,11 @@
 
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
-#skip all tests
-DEB_BUILD_OPTIONS += nocheck
-
-# CamiTK version
-VER_MAJOR=3
-VER_MINOR=3
+# CamiTK version from d/changelog)
+CHANGELOG_VERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: //p')
+FULL_VERSION := $(shell echo '$(CHANGELOG_VERSION)' | sed -e 's/^[[:digit:]]*://' -e 's/[~-].*//')
+VER_MAJOR := $(shell echo '$(FULL_VERSION)' | cut -f1 -d".")
+VER_MINOR := $(shell echo '$(FULL_VERSION)' | cut -f2 -d".")
 VER_SHORT=$(VER_MAJOR).$(VER_MINOR)
 
 # package aliases (see d/control)
@@ -24,19 +23,26 @@
 
 # dpkg-shlibdeps needs to know about camitk extension directories to manage inner-dependencies
 # between extensions (i.e., mml component extension depends on physicalmodel component extensions)
+PKG_LIB_DIR := $(CURDIR)/debian/${pkg_lib}/usr/lib/camitk-${VER_SHORT}
 # for component extensions:
-LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(CURDIR)/debian/${pkg_lib}/usr/lib/camitk-${VER_SHORT}/components/
+LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(PKG_LIB_DIR)/components/
 # for action extensions: 
-LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(CURDIR)/debian/${pkg_lib}/usr/lib/camitk-${VER_SHORT}/actions/
+LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(PKG_LIB_DIR)/actions/
 # for private libraries:
-LD_LIBRARY_PATH:=$(LD_LIBRARY_PATH):$(CURDIR)/debian/${pkg_lib}/usr/lib/camitk-${VER_SHORT}/
+LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(PKG_LIB_DIR)/
+# during test, the build dir path is also needed
+LIB_BUILD_DIR := $(CURDIR)/camitk-build/lib
+PRIVATE_LIB_BUILD_DIR := $(LIB_BUILD_DIR)/camitk-${VER_SHORT}
+LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(LIB_BUILD_DIR):$(PRIVATE_LIB_BUILD_DIR)/components/:$(PRIVATE_LIB_BUILD_DIR)/actions/:$(PRIVATE_LIB_BUILD_DIR)/
+# export for all d/rules subshell (test and dpkg-shlibdeps included)
+export LD_LIBRARY_PATH
 
 # CMake flags are of two types:
 # - generic (to tell cmake to build proper binaries)
 # - CamiTK specific options
 CMAKE_EXTRA_FLAGS = \
-	-DCMAKE_SKIP_RPATH:BOOL=ON \
-	-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=OFF \
+	-DCMAKE_SKIP_RPATH:BOOL=TRUE \
+	-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=FALSE \
 	-DCMAKE_BUILD_TYPE:STRING=None \
 	\
 	-DCEP_IMAGING:BOOL=TRUE \
@@ -44,23 +50,41 @@
 	\
 	-DAPIDOC_SDK:BOOL=TRUE \
 	\
-	-DCAMITK_DICOM_INCOMPLETE_SUPPORT:BOOL=ON 
+	-DCAMITK_DICOM_INCOMPLETE_SUPPORT:BOOL=FALSE \
+	-DCOMPONENT_DICOMDIRECTORY=TRUE \
+	-DCOMPONENT_DICOMIMAGE=TRUE
 
 %:
-	dh $@
+	dh $@ --builddirectory=camitk-build
 
 override_dh_auto_configure:
 	dh_auto_configure -- $(CMAKE_EXTRA_FLAGS)
 
 # let's be smart with doc
 override_dh_auto_build-indep:
-	$(MAKE) -C obj-* apidoc
+	$(MAKE) -C camitk-build apidoc
 	# remove the javascript search field
-	rm -f obj-*/share/camitk-$(VER_SHORT)/apidoc/html/jquery.js
+	rm -f camitk-build/share/camitk-$(VER_SHORT)/apidoc/html/jquery.js
 
 # No tests needed for docs
 override_dh_auto_test-indep:
 
+# a selection of relevant tests
+override_dh_auto_test:
+	# the CamiTK test suite is not 100% relevant yet
+	# Use only some of the tests (basically the one that
+	# pass out of the box in CamiTK 3.3)
+	# Note: all tests require an X server, xvfb-run is needed to have a virtual one
+	# Component extension tests
+	ldd -r camitk-build/bin/camitk-testcomponents || echo "ok"
+	# Another way: xvfb-run --auto-servernum $(MAKE) -C camitk-build ARGS="-V -I 1,1,,1,6,16" test
+	(cd camitk-build && xvfb-run --auto-servernum ctest -V -I 1,1,,1,6,16 --timeout 300)
+	# Action extensions tests (100% coverage here)
+	(cd camitk-build && xvfb-run --auto-servernum ctest -V -I 20,20,,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35 --timeout 300)
+	# Standalone lib test (0% coverage)
+	# TODO remove this override when tests are relevant (hopefully for the next upstream version)
+
+# make packages
 override_dh_install:
 	# $(CURDIR) is the current source dir
 	# camitk dynamic library

Added: trunk/packages/camitk/trunk/debian/tests/config
===================================================================
--- trunk/packages/camitk/trunk/debian/tests/config	                        (rev 0)
+++ trunk/packages/camitk/trunk/debian/tests/config	2014-03-28 11:35:19 UTC (rev 16535)
@@ -0,0 +1,79 @@
+#!/bin/sh
+# Testing the installation: the version, paths and number of extensions should be correct
+# This test entirely depends on the CamitK version (version string, number of extensions...)
+# (see the expectedConfigOutput)
+# 
+# TODO: add complete library tests using cepgenerator
+set -e
+EXPECTED_CONFIG_OUTPUT=$(mktemp)
+CONFIG_OUTPUT=$(mktemp)
+DIFF_OUTPUT=$(mktemp)
+
+# Clean up temporary files
+cleanExit () {
+	echo "Exiting (cleaning up)"
+	rm -f $EXPECTED_CONFIG_OUTPUT $CONFIG_OUTPUT $DIFF_OUTPUT
+	# exit with the given status
+	exit $1
+}
+
+# depending on the CamiTK version, the output is different
+expectedConfigOutput () {
+	if [ "$1" = "3.3.0" ]; then
+		cat <<EOF > $EXPECTED_CONFIG_OUTPUT
+CamiTK 3.3.0
+- CamiTK version......................... CamiTK 3.3.0
+- CamiTK Short Version................... camitk-3.3
+- CamiTK SO NAME......................... 3
+- CamiTK Global Installation Directory... /usr
+- Component Extension Directories........ /usr/lib/camitk-3.3/components
+- Action Extension Directories........... /usr/lib/camitk-3.3/actions
+- Number of Component Extensions......... 12
+- Number of Action Extensions............ 71
+EOF
+	fi
+
+	if [ "$1" = "3.2.2" ]; then
+		cat <<EOF > $EXPECTED_CONFIG_OUTPUT
+- CamiTK version......................... CamiTK 3.2.2
+- CamiTK Short Version................... camitk-3.2
+- CamiTK SO NAME......................... 3
+- CamiTK Global Installation Directory... /usr
+- Component Extension Directories........ /usr/lib/camitk-3.2/components
+- Action Extension Directories........... /usr/lib/camitk-3.2/actions
+- Number of Component Extensions......... 10
+- Number of Action Extensions............ 65
+- Registered components (G=Global, L=Local, W=Working, U=User):
+EOF
+	fi
+}
+
+# if a problem occurs, call the clean method
+trap cleanExit INT QUIT ABRT TERM PIPE
+
+# First determine CamiTK version
+CAMITK_VERSION=$(xvfb-run --auto-servernum --server-num=1 camitk-config --completeVersion | cut -f2 -d" ")
+echo "Detected CamiTK version is $CAMITK_VERSION"
+
+# build the expected output string
+expectedConfigOutput $CAMITK_VERSION
+
+# run the config diagnosis (skipping the user/path dependent part using sed)
+# TODO: update the camitk-config code so that extensions are always listed in the same order
+xvfb-run --auto-servernum --server-num=1 camitk-config --config | sed -n "1,5p; 9,12p" > $CONFIG_OUTPUT
+
+# compare output to expected output
+echo "Checking configuration..."
+
+# || true is to ignore the output of the diff (we need to know more, the set -e would stop the execution of the script here
+# if || true was not added and there was a difference between the two files
+diff --context=1 --suppress-common-lines "$CONFIG_OUTPUT" "$EXPECTED_CONFIG_OUTPUT" > $DIFF_OUTPUT || true
+if [ -s $DIFF_OUTPUT ]; then
+    echo "CamiTK $CAMITK_VERSION configuration: Failed"
+    cat $DIFF_OUTPUT
+    false
+else
+    echo "CamiTK $CAMITK_VERSION configuration: OK"
+    true
+fi
+

Added: trunk/packages/camitk/trunk/debian/tests/control
===================================================================
--- trunk/packages/camitk/trunk/debian/tests/control	                        (rev 0)
+++ trunk/packages/camitk/trunk/debian/tests/control	2014-03-28 11:35:19 UTC (rev 16535)
@@ -0,0 +1,2 @@
+Tests: config
+Depends: libcamitk3 (>=3.2.2), xvfb, xauth




More information about the debian-med-commit mailing list