Code

Adding libtap into distribution to help run C based tests
[nagiosplug.git] / tools / tinderbox_build
index 44e3dfe6a9efdcc4d8a934023d2a5c8cd5e71294..e8a3e2e09e8fad0cd9b4b8d5e84eec82d3897bf1 100755 (executable)
@@ -21,6 +21,7 @@ chomp($myhost);
 my ($host, $junk) = split(/\./, $myhost);
        
 my $BuildAdministrator = $ENV{TINDERBOX_BUILD_ADMIN} || "$ENV{'USER'}\@$myhost";
+my $TmpDir = $ENV{TMPDIR} || "/tmp";
 
 #Default values of cmdline opts
 my $ReportStatus = 0;  # Do not send results to server
@@ -241,8 +242,8 @@ sub SetupPath {
 
 sub configure {
        # Configure
-        print LOG "./configure $ConfigureArgs\n";
-        open (CONFIGURE, "./configure $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
+        print LOG "./configure --enable-libtap $ConfigureArgs\n";
+        open (CONFIGURE, "./configure --enable-libtap $ConfigureArgs 2>&1 |") || die "../configure: $!\n";
         while (<CONFIGURE>) {
             print $_;
             print LOG $_;
@@ -266,13 +267,15 @@ sub make {
 sub maketest {
         # Tests
         print LOG "LANG=C make test 2>&1\n";
-        open( MAKE, "LANG=C make test 2>&1 |");
+        open( MAKE, "LANG=C make test && make install DESTDIR=$TmpDir/tinderbox_build.$$ && make install-strip DESTDIR=$TmpDir/tinderbox_build2.$$ 2>&1 |");
        while ( <MAKE> ) {
                print $_;
                print LOG $_;
        }
        close( MAKE);
-       return ! $?;
+       my $rc = $?;
+       system("rm -fr $TmpDir/tinderbox_build.$$ $TmpDir/tinderbox_build2.$$");
+       return ! $rc;
 }
 
 # Main function