Browse Source

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
svn/tags/lighttpd-1.4.2
Jan Kneschke 17 years ago
parent
commit
1be36e4013
  1. 24
      tests/LightyTest.pm
  2. 6
      tests/cleanup.sh
  3. 4
      tests/prepare.sh

24
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}) {

6
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"

4
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

Loading…
Cancel
Save