1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/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
#if [ "\$PATHTOEXE" = "" ] ; then
# PATHTOEXE=\`find \$CURDIR -name iqtree -type l\`
#fi
echo "Executing tests using \$PATHTOEXE ..."
EOT
grep example.phy iqtree-manual-1.0.tex | \
grep '^ *iqtree' | \
sed "s?^ *iqtree?time \$PATHTOEXE?" \
>> ${OUT}
|