[med-svn] [iqtree] 05/05: Create flexible test script usable at build time and in autopkgtest

Andreas Tille tille at debian.org
Tue Sep 8 20:41:54 UTC 2015


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository iqtree.

commit d24c98f8368608c0f4c928d128972dce4d303699
Author: Andreas Tille <tille at debian.org>
Date:   Tue Sep 8 22:06:26 2015 +0200

    Create flexible test script usable at build time and in autopkgtest
---
 debian/Documents_source/create_example_script | 33 ++++++++++--
 debian/Documents_source/example.sh            | 72 +++++++++++++++++----------
 debian/control                                |  3 +-
 debian/rules                                  | 10 +++-
 4 files changed, 86 insertions(+), 32 deletions(-)

diff --git a/debian/Documents_source/create_example_script b/debian/Documents_source/create_example_script
index 4e70f62..abd0e1c 100755
--- a/debian/Documents_source/create_example_script
+++ b/debian/Documents_source/create_example_script
@@ -1,6 +1,31 @@
 #!/bin/sh
+OUT=example.sh
+cat > $OUT <<EOT
+#!/bin/sh -e
+CURDIR=\`pwd\`
+if [ -d /usr/share/doc/iqtree/examples ] ; then
+  EXAMPLEDIR=/usr/share/doc/iqtree/examples
+else
+  EXAMPLEFILE=\`find \$CURDIR -name example.phy | head -n 1\`
+  EXAMPLEDIR=\`dirname \$EXAMPLEFILE\`
+fi
+
+pkg=iqtree
+if [ "\$ADTTMP" = "" ] ; then
+  ADTTMP=\`mktemp -d /tmp/\${pkg}-test.XXXXXX\`
+fi
+cd \$ADTTMP
+cp -a \$EXAMPLEDIR/example.phy* \$EXAMPLEDIR/example.nex* .
+find . -name "*.gz" -exec gunzip \{\} \;
+
+PATHTOEXE=\`which iqtree\`
+if [ "\$PATHTOEXE" = "" ] ; then
+  PATHTOEXE=\`find \$CURDIR -name iqtree -type f -executable\`
+fi
+echo "Executing tests using \$PATHTOEXE ..."
+EOT
+
 grep example.phy iqtree-manual-1.0.tex | \
-   grep "^ *iqtree" | \
-   sed -e 's?example.phy?/usr/share/doc/iqtree/examples/&?' \
-       -e 's?example.nex?/usr/share/doc/iqtree/examples/&?' \
-  > example.sh
+   grep '^ *iqtree' | \
+   sed "s?^ *iqtree?time \$PATHTOEXE?" \
+  >> ${OUT}
diff --git a/debian/Documents_source/example.sh b/debian/Documents_source/example.sh
index 3458968..9bf139c 100644
--- a/debian/Documents_source/example.sh
+++ b/debian/Documents_source/example.sh
@@ -1,25 +1,47 @@
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -pre myprefix
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -nni1
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TEST
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TIM+I+G
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TESTONLY
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -pll -m GTR+G
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TIM+I+G -bb 1000
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TIM+I+G -b 100
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TIM+I+G -alrt 1000
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TIM+I+G -lbp 1000
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TIM+I+G -alrt 1000 -lbp 1000
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m TIM+I+G -bb 1000 -alrt 1000 -lbp 1000
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -sp /usr/share/doc/iqtree/examples/example.nex
-  iqtree-omp -s /usr/share/doc/iqtree/examples/example.phy
-  iqtree-omp -s /usr/share/doc/iqtree/examples/example.phy -omp 2
-  iqtree-omp -s /usr/share/doc/iqtree/examples/example.phy -omp 3
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -z example.treels
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -z example.treels -n 1
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -z example.treels -n 1 -zb 1000
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -z example.treels -n 1 -zb 1000 -zw
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m 010010+G
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m mymodel+G
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m 'TN{2.0,3.0}+G8{0.5}+I{0.15}'
-  iqtree -s /usr/share/doc/iqtree/examples/example.phy -m GTR+G+Fo
+#!/bin/sh -e
+CURDIR=`pwd`
+if [ -d /usr/share/doc/iqtree/examples ] ; then
+  EXAMPLEDIR=/usr/share/doc/iqtree/examples
+else
+  EXAMPLEFILE=`find $CURDIR -name example.phy | head -n 1`
+  EXAMPLEDIR=`dirname $EXAMPLEFILE`
+fi
+
+pkg=iqtree
+if [ "$ADTTMP" = "" ] ; then
+  ADTTMP=`mktemp -d /tmp/${pkg}-test.XXXXXX`
+fi
+cd $ADTTMP
+cp -a $EXAMPLEDIR/example.phy* $EXAMPLEDIR/example.nex* .
+find . -name "*.gz" -exec gunzip \{\} \;
+
+PATHTOEXE=`which iqtree`
+if [ "$PATHTOEXE" = "" ] ; then
+  PATHTOEXE=`find $CURDIR -name iqtree -type f -executable`
+fi
+echo "Executing tests using $PATHTOEXE ..."
+time $PATHTOEXE -s example.phy
+time $PATHTOEXE -s example.phy -pre myprefix
+time $PATHTOEXE -s example.phy -nni1
+time $PATHTOEXE -s example.phy -m TEST
+time $PATHTOEXE -s example.phy -m TIM+I+G
+time $PATHTOEXE -s example.phy -m TESTONLY
+time $PATHTOEXE -s example.phy -pll -m GTR+G
+time $PATHTOEXE -s example.phy -m TIM+I+G -bb 1000
+time $PATHTOEXE -s example.phy -m TIM+I+G -b 100
+time $PATHTOEXE -s example.phy -m TIM+I+G -alrt 1000
+time $PATHTOEXE -s example.phy -m TIM+I+G -lbp 1000
+time $PATHTOEXE -s example.phy -m TIM+I+G -alrt 1000 -lbp 1000
+time $PATHTOEXE -s example.phy -m TIM+I+G -bb 1000 -alrt 1000 -lbp 1000
+time $PATHTOEXE -s example.phy -sp example.nex
+time $PATHTOEXE-omp -s example.phy
+time $PATHTOEXE-omp -s example.phy -omp 2
+time $PATHTOEXE-omp -s example.phy -omp 3
+time $PATHTOEXE -s example.phy -z example.treels
+time $PATHTOEXE -s example.phy -z example.treels -n 1
+time $PATHTOEXE -s example.phy -z example.treels -n 1 -zb 1000
+time $PATHTOEXE -s example.phy -z example.treels -n 1 -zb 1000 -zw
+time $PATHTOEXE -s example.phy -m 010010+G
+time $PATHTOEXE -s example.phy -m mymodel+G
+time $PATHTOEXE -s example.phy -m 'TN{2.0,3.0}+G8{0.5}+I{0.15}'
+time $PATHTOEXE -s example.phy -m GTR+G+Fo
diff --git a/debian/control b/debian/control
index 3ba4c8a..9ec8622 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,8 @@ Build-Depends: debhelper (>= 9),
                libeigen3-dev,
                libsprng2-dev,
                zlib1g-dev,
-               help2man
+               help2man,
+               time
 Standards-Version: 3.9.6
 Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/iqtree.git
 Vcs-Git: git://anonscm.debian.org/debian-med/iqtree.git
diff --git a/debian/rules b/debian/rules
index a80ae3a..2aa2fff 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,8 +25,14 @@ override_dh_installman:
 	    --name='efficient phylogenetic software by maximum likelihood' \
 	    --version-string="$(version)" $(CURDIR)/debian/$(pkg)/usr/bin/iqtree > $(mandir)/iqtree.1
 
-override_dh_compress:
-	dh_compress --exclude=.phy --exclude=.nex
+override_dh_auto_test:
+	# use only the first example for build time test to save time on autobuilders
+	sed '/ myprefix/,$$d' debian/Documents_source/example.sh > example.short
+	time sh example.short
+	rm example.short
+
+#override_dh_compress:
+#	dh_compress --exclude=.phy --exclude=.nex
 
 get-orig-source:
 	uscan --verbose --force-download --repack --compression xz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/iqtree.git



More information about the debian-med-commit mailing list