bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch out of source builds


From: Dmitry Goncharov
Subject: patch out of source builds
Date: Fri, 13 Sep 2019 21:40:49 -0400

Good morning.

This patch makes the test suite look for config.status in the -make_path
directory to allow testing out of source builds.

regards, Dmitry

diff --git a/tests/README b/tests/README
index 0cb7eac..5ecf392 100644
--- a/tests/README
+++ b/tests/README
@@ -82,12 +82,9 @@ ChangeLog in the tests directory for pointers.

 The second serious problem is that it's not parallelizable: it scribbles
 all over its installation directory and so can only test one make at a
-time.  The third serious problem is that it's not relocatable: the only
-way it works when you build out of the source tree is to create
-symlinks, which doesn't work on every system and is bogus to boot.  The
-fourth serious problem is that it doesn't create its own sandbox when
-running tests, so that if a test forgets to clean up after itself that
-can impact future tests.
+time. The third serious problem is that it doesn't create its own
+sandbox when running tests, so that if a test forgets to clean up after
+itself that can impact future tests.


 Bugs
diff --git a/tests/run_make_tests.pl b/tests/run_make_tests.pl
index 7e969a9..437f768 100644
--- a/tests/run_make_tests.pl
+++ b/tests/run_make_tests.pl
@@ -75,12 +75,13 @@ require "test_driver.pl";
 %CONFIG_FLAGS = ();

 my $statnm = "$FindBin::Bin/../config.status";
+my $config_status_errno = "";
 if (open(my $fh, '<', $statnm)) {
     while (my $line = <$fh>) {
         $line =~ m/^[SD]\["([^\"]+)"\]=" *(.*)"/ and $CONFIG_FLAGS{$1} = $2;
     }
 } else {
-    warn "Failed to open $statnm: $!";
+    $config_status_errno = $!;
 }

 # Some target systems might not have the POSIX module...
@@ -98,6 +99,19 @@ sub valid_option
            print "$option $make_path: Not found.\n";
            exit 0;
        }
+       if ($config_status_errno) {
+           my $dir = File::Basename::dirname("$make_path");
+           $statnm = "$dir/config.status";
+           if (open(my $fh, '<', $statnm)) {
+               while (my $line = <$fh>) {
+                   $line =~ m/^[SD]\["([^\"]+)"\]=" *(.*)"/ and
+                                                        $CONFIG_FLAGS{$1} = $2;
+               }
+               $config_status_errno = "";
+           } else {
+               $config_status_errno = $!;
+           }
+       }
        return 1;
    }

@@ -138,6 +152,13 @@ sub valid_option
    return 0;
 }

+sub print_failed_to_open_configstatus
+{
+   if ($config_status_errno) {
+       warn "Failed to open $statnm: $config_status_errno";
+   }
+}
+

 # This is an "all-in-one" function.  Arguments are as follows:
 #
diff --git a/tests/test_driver.pl b/tests/test_driver.pl
index 4af84da..e1235ca 100644
--- a/tests/test_driver.pl
+++ b/tests/test_driver.pl
@@ -516,6 +516,7 @@ sub parse_command_line
       push(@TESTS,$option);
     }
   }
+  &print_failed_to_open_configstatus;
 }

 sub max



reply via email to

[Prev in Thread] Current Thread [Next in Thread]