diff options
author | Jan Kneschke <jan@kneschke.de> | 2005-08-29 13:43:46 +0000 |
---|---|---|
committer | Jan Kneschke <jan@kneschke.de> | 2005-08-29 13:43:46 +0000 |
commit | 1be36e40138ae018b7636c33e48f119babda3f1f (patch) | |
tree | 0c9ffee5280939c1737d7e063b64effc4b6a8f94 /tests | |
parent | 849cbb728e402af50ff228cf37520b27822c1a8a (diff) | |
download | lighttpd-git-1be36e40138ae018b7636c33e48f119babda3f1f.tar.gz |
make 'make distcheck' happy and install files into _build/tests/
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@645 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/LightyTest.pm | 24 | ||||
-rwxr-xr-x | tests/cleanup.sh | 6 | ||||
-rwxr-xr-x | tests/prepare.sh | 4 |
3 files changed, 20 insertions, 14 deletions
diff --git a/tests/LightyTest.pm b/tests/LightyTest.pm index 0578a7f8..23a9eaa2 100755 --- a/tests/LightyTest.pm +++ b/tests/LightyTest.pm @@ -17,14 +17,20 @@ sub new { chomp $lpath; $self->{BASEDIR} = $lpath; + $lpath = (defined $ENV{'top_builddir'} ? $ENV{'top_builddir'}."/tests/" : '.'); + $lpath = `readlink -f '$lpath'`; + chomp $lpath; + $self->{TESTDIR} = $lpath; + $lpath = (defined $ENV{'srcdir'} ? $ENV{'srcdir'} : '.'); -# $lpath = `readlink -f '$lpath'`; -# chomp $lpath; + $lpath = `readlink -f '$lpath'`; + chomp $lpath; $self->{SRCDIR} = $lpath; + $self->{LIGHTTPD_PATH} = $self->{BASEDIR}.'/src/lighttpd'; - $self->{LIGHTTPD_PIDFILE} = $self->{SRCDIR}.'/tmp/lighttpd/lighttpd.pid'; - $self->{PIDOF_PIDFILE} = $self->{SRCDIR}.'/tmp/lighttpd/pidof.pid'; + $self->{LIGHTTPD_PIDFILE} = $self->{TESTDIR}.'/tmp/lighttpd/lighttpd.pid'; + $self->{PIDOF_PIDFILE} = $self->{TESTDIR}.'/tmp/lighttpd/pidof.pid'; $self->{PORT} = 2048; bless($self, $class); @@ -72,22 +78,22 @@ sub start_proc { # pre-process configfile if necessary # - unlink($self->{SRCDIR}."/tmp/cfg.file"); - system("cat ".$self->{SRCDIR}."/".$self->{CONFIGFILE}.' | perl -pe "s#\@SRCDIR\@#'.$self->{BASEDIR}.'/tests/#" > '.$self->{SRCDIR}.'/tmp/cfg.file'); + unlink($self->{TESTDIR}."/tmp/cfg.file"); + system("cat ".$self->{SRCDIR}."/".$self->{CONFIGFILE}.' | perl -pe "s#\@SRCDIR\@#'.$self->{BASEDIR}.'/tests/#" > '.$self->{TESTDIR}.'/tmp/cfg.file'); unlink($self->{LIGHTTPD_PIDFILE}); if (1) { - system($self->{LIGHTTPD_PATH}." -f ".$self->{SRCDIR}."/tmp/cfg.file -m ".$self->{BASEDIR}."/src/.libs"); + system($self->{LIGHTTPD_PATH}." -f ".$self->{TESTDIR}."/tmp/cfg.file -m ".$self->{BASEDIR}."/src/.libs"); select(undef, undef, undef, 0.1); } else { - system("valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --logfile=foo ".$self->{LIGHTTPD_PATH}." -D -f ".$self->{SRCDIR}."/tmp/cfg.file -m ".$self->{BASEDIR}."/src/.libs &"); + system("valgrind --tool=memcheck --show-reachable=yes --leak-check=yes --logfile=foo ".$self->{LIGHTTPD_PATH}." -D -f ".$self->{TESTDIR}."/tmp/cfg.file -m ".$self->{BASEDIR}."/src/.libs &"); select(undef, undef, undef, 2); } # sleep(1); - unlink($self->{SRCDIR}."/tmp/cfg.file"); + unlink($self->{TESTDIR}."/tmp/cfg.file"); # no pidfile, we failed if (not -e $self->{LIGHTTPD_PIDFILE}) { diff --git a/tests/cleanup.sh b/tests/cleanup.sh index a02ae9ae..5ee34a62 100755 --- a/tests/cleanup.sh +++ b/tests/cleanup.sh @@ -4,10 +4,10 @@ if test x$srcdir = x; then srcdir=. fi -tmpdir=$srcdir/tmp/lighttpd +tmpdir=$top_builddir/tests/tmp/ -# create test-framework -# rm -rf $tmpdir +# remove test-framework +rm -rf $tmpdir printf "%-40s" "cleaning up" diff --git a/tests/prepare.sh b/tests/prepare.sh index faa5e781..10033491 100755 --- a/tests/prepare.sh +++ b/tests/prepare.sh @@ -4,7 +4,7 @@ if test x$srcdir = x; then srcdir=. fi -tmpdir=$srcdir/tmp/lighttpd +tmpdir=$top_builddir/tests/tmp/lighttpd # create test-framework rm -rf $tmpdir @@ -33,7 +33,7 @@ cp $srcdir/docroot/123/*.txt \ $srcdir/docroot/123/*.php \ $srcdir/docroot/123/*.bla $tmpdir/servers/123.example.org/pages/ cp $srcdir/lighttpd.user $tmpdir/ -cp $srcdir/var-include-sub.conf $srcdir/tmp +cp $srcdir/var-include-sub.conf $tmpdir/../ touch $tmpdir/servers/www.example.org/pages/image.jpg \ $tmpdir/servers/www.example.org/pages/image.JPG \ $tmpdir/servers/www.example.org/pages/a |