summaryrefslogtreecommitdiff
path: root/tests/LightyTest.pm
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-08-29 13:43:46 +0000
committerJan Kneschke <jan@kneschke.de>2005-08-29 13:43:46 +0000
commit1be36e40138ae018b7636c33e48f119babda3f1f (patch)
tree0c9ffee5280939c1737d7e063b64effc4b6a8f94 /tests/LightyTest.pm
parent849cbb728e402af50ff228cf37520b27822c1a8a (diff)
downloadlighttpd-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/LightyTest.pm')
-rwxr-xr-xtests/LightyTest.pm24
1 files changed, 15 insertions, 9 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}) {