[Pkg-octave-commit] [SCM] octave-pkg-dev branch, master, updated. 73c2c1385bcbeac9eb2d666f7a2f1dc38b06b50c
Thomas Weber
tweber at debian.org
Sun Feb 20 19:34:58 UTC 2011
The following commit has been merged in the master branch:
commit 73c2c1385bcbeac9eb2d666f7a2f1dc38b06b50c
Author: Thomas Weber <tweber at debian.org>
Date: Sun Feb 20 20:34:38 2011 +0100
Search for tests in .cc files
diff --git a/debian/changelog b/debian/changelog
index 0b1e534..3eaf5a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
octave-pkg-dev (0.7.4) UNRELEASED; urgency=low
* Bump Standards-Version to 3.9.1, no changes needed
+ * Search for tests in .cc files and execute them.
-- Thomas Weber <tweber at debian.org> Fri, 18 Feb 2011 00:20:50 +0100
diff --git a/debian/copyright b/debian/copyright
index c9d36ed..1de7d73 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -6,6 +6,7 @@ Upstream-Source: git://git.debian.org/git/pkg-octave/octave-pkg-dev.git
Files: *
Copyright: © 2008 Ólafur Jens Sigurðsson <ojsbug at gmail.com>
© 2008, 2009 Rafael Laboissiere <rafael at debian.org>
+ © 2011 Thomas Weber <tweber at debian.org>
License: GPL-3+
On Debian systems, the complete text of the GNU General Public
License, version 3, can be found in the file
diff --git a/octave-pkg.mk.in b/octave-pkg.mk.in
index d269194..15f52c5 100644
--- a/octave-pkg.mk.in
+++ b/octave-pkg.mk.in
@@ -88,6 +88,8 @@ check-pkg:
@echo Checking package...
+# Extract tests from installed m files
+ @echo Checking m files ...
@tmp=$$(tempfile) ; \
echo "addpath (genpath ([pwd(),'/debian']));" > $$tmp ; \
find debian/ -name \*.m \
@@ -98,6 +100,32 @@ check-pkg:
@OCTAVE@ $(octave_options) $$tmp ; \
rm -f $$tmp
+# Extract tests from .cc files - these are not installed, but the
+# compiled .oct files are.
+# We search for the tests in the .cc files, but invoke the .oct files;
+# this means we must add generate a loadpath starting at the current
+# directory and source PKG_ADD files (they might add autoload()
+# directives)
+
+# We deactivate the warning about relative paths used for the PKG_ADD file.
+ @echo Checking CC files ...
+ @tmp=$$(tempfile) ; \
+ echo "addpath (genpath ([pwd()]));" >> $$tmp ; \
+ echo "warning ('off', 'Octave:autoload-relative-file-name');" >> $$tmp ; \
+ if [ -f PKG_ADD ] ; then \
+ echo "source('PKG_ADD');" >> $$tmp ; \
+ fi ; \
+ if [ -f PKG_ADD.bak ] ; then \
+ echo "source('PKG_ADD.bak');" >> $$tmp ; \
+ fi ; \
+ find src/ -name \*.cc \
+ | xargs grep -l '^%!\(assert\|test\)' \
+ | perl -pe 's:.*/(.*)\.cc::; \
+ print "disp (\"[$$1]\")\ntest $$1"' \
+ >> $$tmp ; \
+ octave3.2 $(octave_options) $$tmp ; \
+ rm -f $$tmp
+
@if [ -f debian/check.m ] ; then \
@OCTAVE@ $(octave_options) --eval \
"addpath (genpath ([pwd(),'/debian'])); \
--
octave-pkg-dev
More information about the Pkg-octave-commit
mailing list