summaryrefslogtreecommitdiff
path: root/infrastructure/makebuildenv.pl.in
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2006-11-26 19:45:44 +0000
committerChris Wilson <chris+github@qwirx.com>2006-11-26 19:45:44 +0000
commit042f6b6802eca9249670ae30919d5a398a1cc97d (patch)
treeb4f9ff30d0e1c365140752839f5972de6f9df4cf /infrastructure/makebuildenv.pl.in
parentaa1e32e97f007a547e57cd6be5ecf190b4ff7cfd (diff)
* Try to kill any daemons left over from previous tests before running
new tests. * Try to kill any remaining daemons at the end of the test (refs #3)
Diffstat (limited to 'infrastructure/makebuildenv.pl.in')
-rwxr-xr-xinfrastructure/makebuildenv.pl.in26
1 files changed, 24 insertions, 2 deletions
diff --git a/infrastructure/makebuildenv.pl.in b/infrastructure/makebuildenv.pl.in
index 75912ca1..09176c9c 100755
--- a/infrastructure/makebuildenv.pl.in
+++ b/infrastructure/makebuildenv.pl.in
@@ -401,24 +401,46 @@ for my $mod (@implicit_deps, @modules)
sub writetestfile
{
my ($filename,$runcmd,$module) = @_;
- open TESTFILE,">$filename" or die "Can't open test script file for $module for writing\n";
+
+ open TESTFILE,">$filename" or die "Can't open " .
+ "test script file for $module for writing\n";
print TESTFILE "#!/bin/sh\necho TEST: $module\n";
+
if(-d "$module/testfiles")
{
print TESTFILE <<__E;
+echo Killing any running daemons...
+test -r testfiles/bbackupd.pid && kill `cat testfiles/bbackupd.pid`
+test -r testfiles/bbstored.pid && kill `cat testfiles/bbstored.pid`
+
echo Removing old test files...
rm -rf testfiles
+
echo Copying new test files...
cp -p -R ../../../$module/testfiles .
+
__E
}
+
if(-e "$module/testextra")
{
- open FL,"$module/testextra" or die "Can't open $module/testextra";
+ open FL,"$module/testextra" or die
+ "Can't open $module/testextra";
while(<FL>) {print TESTFILE}
close FL;
}
+
print TESTFILE "$runcmd\n";
+
+ if(-d "$module/testfiles")
+ {
+ print TESTFILE <<__E;
+# echo Killing any running daemons...
+test -r testfiles/bbackupd.pid && kill `cat testfiles/bbackupd.pid`
+test -r testfiles/bbstored.pid && kill `cat testfiles/bbstored.pid`
+__E
+ }
+
close TESTFILE;
}