From: Miek Gieben Date: Fri, 7 Oct 2005 19:31:08 +0000 (+0000) Subject: Added a test directory. This scripts can be executed by utilizing X-Git-Tag: release-1.0.0~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c299473478d079ceb3cfd561111b3f376b73ab07;p=thirdparty%2Fldns.git Added a test directory. This scripts can be executed by utilizing tpkg Seems to work fine :-) % tpkg report 01-checkout: ** PASSED ** : check out libdns from svn and compile it 02-lint: ** PASSED ** : Do a make lint on libdns 99-cleanup: ** PASSED ** : Cleaning up the builddir --- diff --git a/test/01-checkout.tpkg b/test/01-checkout.tpkg new file mode 100644 index 00000000..d4322a3e --- /dev/null +++ b/test/01-checkout.tpkg @@ -0,0 +1,142 @@ +#!/bin/sh +# This is a shell archive (produced by GNU sharutils 4.2.1). +# To extract the files from this archive, save it to some FILE, remove +# everything before the `!/bin/sh' line above, then type `sh FILE'. +# +# Made on 2005-10-07 21:15 CEST by . +# Source directory was `/home/miekg/svn/libdns/trunk/test'. +# +# Existing files will *not* be overwritten unless `-c' is specified. +# +# This shar contains: +# length mode name +# ------ ---------- ------------------------------------------ +# 252 -rw------- 01-checkout.dsc +# 304 -rw------- 01-checkout.test +# +save_IFS="${IFS}" +IFS="${IFS}:" +gettext_dir=FAILED +locale_dir=FAILED +first_param="$1" +for dir in $PATH +do + if test "$gettext_dir" = FAILED && test -f $dir/gettext \ + && ($dir/gettext --version >/dev/null 2>&1) + then + set `$dir/gettext --version 2>&1` + if test "$3" = GNU + then + gettext_dir=$dir + fi + fi + if test "$locale_dir" = FAILED && test -f $dir/shar \ + && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) + then + locale_dir=`$dir/shar --print-text-domain-dir` + fi +done +IFS="$save_IFS" +if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED +then + echo=echo +else + TEXTDOMAINDIR=$locale_dir + export TEXTDOMAINDIR + TEXTDOMAIN=sharutils + export TEXTDOMAIN + echo="$gettext_dir/gettext -s" +fi +if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then + shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' +elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' +elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$2 "$8"' +else + shar_touch=: + echo + $echo 'WARNING: not restoring timestamps. Consider getting and' + $echo "installing GNU \`touch', distributed in GNU File Utilities..." + echo +fi +rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch +# +if mkdir _sh24199; then + $echo 'x -' 'creating lock directory' +else + $echo 'failed to create lock directory' + exit 1 +fi +# ============= 01-checkout.dsc ============== +if test -f '01-checkout.dsc' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '01-checkout.dsc' '(file already exists)' +else + $echo 'x -' extracting '01-checkout.dsc' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '01-checkout.dsc' && +BaseName: 01-checkout +Version: 1.0 +Description: check out libdns from svn and compile it +CreationDate: Fri Oct 7 21:09:03 CEST 2005 +Maintainer: Miek Gieben +Category: +Component: +Depends: +Pre: +Post: +Test: 01-checkout.test +AuxFiles: +Passed: +Failure: +SHAR_EOF + (set 20 05 10 07 21 09 27 '01-checkout.dsc'; eval "$shar_touch") && + chmod 0600 '01-checkout.dsc' || + $echo 'restore of' '01-checkout.dsc' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '01-checkout.dsc:' 'MD5 check failed' +15a00891f55acc8f401e0f819cecda8c 01-checkout.dsc +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '01-checkout.dsc'`" + test 252 -eq "$shar_count" || + $echo '01-checkout.dsc:' 'original size' '252,' 'current size' "$shar_count!" + fi +fi +# ============= 01-checkout.test ============== +if test -f '01-checkout.test' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '01-checkout.test' '(file already exists)' +else + $echo 'x -' extracting '01-checkout.test' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '01-checkout.test' && +[ -f /home/miekg/svn/libdns/trunk/test/tpkg.var ] && source /home/miekg/svn/libdns/trunk/test/tpkg.var +X +TPKG_BUILD=`mktemp -d` +X +echo "TPKG_BUILD=$TPKG_BUILD" >> $TPKG_VAR +X +svn co svn+ssh://open.nlnetlabs.nl/svn/libdns/trunk $TPKG_BUILD +X +cd $TPKG_BUILD +libtoolize && autoreconf && \ +X./configure && \ +make +SHAR_EOF + (set 20 05 10 07 21 12 48 '01-checkout.test'; eval "$shar_touch") && + chmod 0600 '01-checkout.test' || + $echo 'restore of' '01-checkout.test' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '01-checkout.test:' 'MD5 check failed' +0fb62fd873c6948604310d61c21f39c3 01-checkout.test +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '01-checkout.test'`" + test 304 -eq "$shar_count" || + $echo '01-checkout.test:' 'original size' '304,' 'current size' "$shar_count!" + fi +fi +rm -fr _sh24199 +exit 0 diff --git a/test/02-lint.tpkg b/test/02-lint.tpkg new file mode 100644 index 00000000..2cb63e55 --- /dev/null +++ b/test/02-lint.tpkg @@ -0,0 +1,134 @@ +#!/bin/sh +# This is a shell archive (produced by GNU sharutils 4.2.1). +# To extract the files from this archive, save it to some FILE, remove +# everything before the `!/bin/sh' line above, then type `sh FILE'. +# +# Made on 2005-10-07 21:25 CEST by . +# Source directory was `/home/miekg/svn/libdns/trunk/test/tmp.lCFrmz'. +# +# Existing files will *not* be overwritten unless `-c' is specified. +# +# This shar contains: +# length mode name +# ------ ---------- ------------------------------------------ +# 252 -rw------- 02-lint.dsc +# 130 -rw------- 02-lint.test +# +save_IFS="${IFS}" +IFS="${IFS}:" +gettext_dir=FAILED +locale_dir=FAILED +first_param="$1" +for dir in $PATH +do + if test "$gettext_dir" = FAILED && test -f $dir/gettext \ + && ($dir/gettext --version >/dev/null 2>&1) + then + set `$dir/gettext --version 2>&1` + if test "$3" = GNU + then + gettext_dir=$dir + fi + fi + if test "$locale_dir" = FAILED && test -f $dir/shar \ + && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) + then + locale_dir=`$dir/shar --print-text-domain-dir` + fi +done +IFS="$save_IFS" +if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED +then + echo=echo +else + TEXTDOMAINDIR=$locale_dir + export TEXTDOMAINDIR + TEXTDOMAIN=sharutils + export TEXTDOMAIN + echo="$gettext_dir/gettext -s" +fi +if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then + shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' +elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' +elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$2 "$8"' +else + shar_touch=: + echo + $echo 'WARNING: not restoring timestamps. Consider getting and' + $echo "installing GNU \`touch', distributed in GNU File Utilities..." + echo +fi +rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch +# +if mkdir _sh31473; then + $echo 'x -' 'creating lock directory' +else + $echo 'failed to create lock directory' + exit 1 +fi +# ============= 02-lint.dsc ============== +if test -f '02-lint.dsc' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '02-lint.dsc' '(file already exists)' +else + $echo 'x -' extracting '02-lint.dsc' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '02-lint.dsc' && +BaseName: 02-lint +Version: 1.0 +Description: Do a make lint on libdns +CreationDate: Fri Oct 7 21:16:30 CEST 2005 +Maintainer: Miek Gieben +Category: +Component: +Depends: +Pre: 02-lint.pre +Post: 02-lint.post +Test: 02-lint.test +AuxFiles: +Passed: +Failure: +SHAR_EOF + (set 20 05 10 07 21 24 57 '02-lint.dsc'; eval "$shar_touch") && + chmod 0600 '02-lint.dsc' || + $echo 'restore of' '02-lint.dsc' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '02-lint.dsc:' 'MD5 check failed' +addeffc82d9eb22e484b94045dfdce99 02-lint.dsc +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '02-lint.dsc'`" + test 252 -eq "$shar_count" || + $echo '02-lint.dsc:' 'original size' '252,' 'current size' "$shar_count!" + fi +fi +# ============= 02-lint.test ============== +if test -f '02-lint.test' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '02-lint.test' '(file already exists)' +else + $echo 'x -' extracting '02-lint.test' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '02-lint.test' && +[ -f /home/miekg/svn/libdns/trunk/test/tpkg.var ] && source /home/miekg/svn/libdns/trunk/test/tpkg.var +X +cd $TPKG_BUILD +make lint +SHAR_EOF + (set 20 05 10 07 21 20 22 '02-lint.test'; eval "$shar_touch") && + chmod 0600 '02-lint.test' || + $echo 'restore of' '02-lint.test' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '02-lint.test:' 'MD5 check failed' +cd023451e1cff93cf527f90f2a3ec7ad 02-lint.test +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '02-lint.test'`" + test 130 -eq "$shar_count" || + $echo '02-lint.test:' 'original size' '130,' 'current size' "$shar_count!" + fi +fi +rm -fr _sh31473 +exit 0 diff --git a/test/99-cleanup.tpkg b/test/99-cleanup.tpkg new file mode 100644 index 00000000..05ec3ef3 --- /dev/null +++ b/test/99-cleanup.tpkg @@ -0,0 +1,134 @@ +#!/bin/sh +# This is a shell archive (produced by GNU sharutils 4.2.1). +# To extract the files from this archive, save it to some FILE, remove +# everything before the `!/bin/sh' line above, then type `sh FILE'. +# +# Made on 2005-10-07 21:26 CEST by . +# Source directory was `/home/miekg/svn/libdns/trunk/test/tmp.AFmbyz'. +# +# Existing files will *not* be overwritten unless `-c' is specified. +# +# This shar contains: +# length mode name +# ------ ---------- ------------------------------------------ +# 235 -rw------- 99-cleanup.dsc +# 142 -rw------- 99-cleanup.test +# +save_IFS="${IFS}" +IFS="${IFS}:" +gettext_dir=FAILED +locale_dir=FAILED +first_param="$1" +for dir in $PATH +do + if test "$gettext_dir" = FAILED && test -f $dir/gettext \ + && ($dir/gettext --version >/dev/null 2>&1) + then + set `$dir/gettext --version 2>&1` + if test "$3" = GNU + then + gettext_dir=$dir + fi + fi + if test "$locale_dir" = FAILED && test -f $dir/shar \ + && ($dir/shar --print-text-domain-dir >/dev/null 2>&1) + then + locale_dir=`$dir/shar --print-text-domain-dir` + fi +done +IFS="$save_IFS" +if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED +then + echo=echo +else + TEXTDOMAINDIR=$locale_dir + export TEXTDOMAINDIR + TEXTDOMAIN=sharutils + export TEXTDOMAIN + echo="$gettext_dir/gettext -s" +fi +if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then + shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"' +elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"' +elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then + shar_touch='touch -am $3$4$5$6$2 "$8"' +else + shar_touch=: + echo + $echo 'WARNING: not restoring timestamps. Consider getting and' + $echo "installing GNU \`touch', distributed in GNU File Utilities..." + echo +fi +rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch +# +if mkdir _sh31592; then + $echo 'x -' 'creating lock directory' +else + $echo 'failed to create lock directory' + exit 1 +fi +# ============= 99-cleanup.dsc ============== +if test -f '99-cleanup.dsc' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '99-cleanup.dsc' '(file already exists)' +else + $echo 'x -' extracting '99-cleanup.dsc' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '99-cleanup.dsc' && +BaseName: 99-cleanup +Version: 1.0 +Description: Cleaning up the builddir +CreationDate: Fri Oct 7 21:22:58 CEST 2005 +Maintainer: Miek Gieben +Category: +Component: +Depends: +Pre: +Post: +Test: 99-cleanup.test +AuxFiles: +Passed: +Failure: +SHAR_EOF + (set 20 05 10 07 21 25 31 '99-cleanup.dsc'; eval "$shar_touch") && + chmod 0600 '99-cleanup.dsc' || + $echo 'restore of' '99-cleanup.dsc' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '99-cleanup.dsc:' 'MD5 check failed' +b1e9acaffc0b37e057b288efc1a0c7d0 99-cleanup.dsc +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '99-cleanup.dsc'`" + test 235 -eq "$shar_count" || + $echo '99-cleanup.dsc:' 'original size' '235,' 'current size' "$shar_count!" + fi +fi +# ============= 99-cleanup.test ============== +if test -f '99-cleanup.test' && test "$first_param" != -c; then + $echo 'x -' SKIPPING '99-cleanup.test' '(file already exists)' +else + $echo 'x -' extracting '99-cleanup.test' '(text)' + sed 's/^X//' << 'SHAR_EOF' > '99-cleanup.test' && +[ -f /home/miekg/svn/libdns/trunk/test/tpkg.var ] && source /home/miekg/svn/libdns/trunk/test/tpkg.var +X +# cleanup the mess +rm -rf $TPKG_BUILD +SHAR_EOF + (set 20 05 10 07 21 24 14 '99-cleanup.test'; eval "$shar_touch") && + chmod 0600 '99-cleanup.test' || + $echo 'restore of' '99-cleanup.test' 'failed' + if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \ + && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then + md5sum -c << SHAR_EOF >/dev/null 2>&1 \ + || $echo '99-cleanup.test:' 'MD5 check failed' +e2e85c757f85175c39d6084ccebea19d 99-cleanup.test +SHAR_EOF + else + shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '99-cleanup.test'`" + test 142 -eq "$shar_count" || + $echo '99-cleanup.test:' 'original size' '142,' 'current size' "$shar_count!" + fi +fi +rm -fr _sh31592 +exit 0