]> git.ipfire.org Git - thirdparty/make.git/commitdiff
tests: Allow run_make_test() to avoid passing -f
authorPaul Smith <psmith@gnu.org>
Sat, 26 Feb 2022 22:19:42 +0000 (17:19 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 27 Feb 2022 22:47:42 +0000 (17:47 -0500)
We already use undef makefile strings to mean "re-use the previous
makefile", so if the string is empty we'll assume it means "don't
use a makefile at all" (don't add -f).

* tests/run_make_tests.pl (run_make_test): If the makefile string
is empty, don't create a makefile or add -f.
* tests/scripts/features/include: Change empty makefile to "\n".
* tests/scripts/misc/close_stdout: Ditto.
* tests/scripts/options/dash-r: Ditto.

tests/run_make_tests.pl
tests/scripts/features/include
tests/scripts/misc/close_stdout
tests/scripts/options/dash-r

index 7b61307073d2308e78e2efaaae4e924ec7475fde..f64ff8f0e704761d59a2551e93085c7180c5ac5b 100644 (file)
@@ -269,7 +269,7 @@ sub run_make_test
     defined $old_makefile
       or die "run_make_test(undef) invoked before run_make_test('...')\n";
     $makefile = $old_makefile;
-  } else {
+  } elsif ($makestring) {
     if (! defined($makefile)) {
       $makefile = &get_tmpfile();
     }
index 00c128aa34235f9bce67cd25b14d36c9b0d4a723..14741609edb0245a857ed4d7b1ba073aea647655 100644 (file)
@@ -216,7 +216,7 @@ rmfiles('inc1', 'inc2', 'hellod/inc1', 'hellod/inc2');
 rmdir('hellod');
 
 # No target gets correct error
-run_make_test('', '', '#MAKE#: *** No targets.  Stop.', 512);
+run_make_test("\n", '', '#MAKE#: *** No targets.  Stop.', 512);
 
 # No target in included file either, still gets correct error.
 touch('inc1.mk');
index b16ea8da548ae4531a448c23068d140db4bffbc8..c8c839e7f2d0d7ca6cd8134a574e2a76438ad521 100644 (file)
@@ -4,6 +4,6 @@ $description = "Make sure make exits with an error if stdout is full.";
 
 -e '/dev/full' or return -1;
 
-run_make_test('', '-v > /dev/full', '/^#MAKE#: write error/', 256);
+run_make_test("\n", '-v > /dev/full', '/^#MAKE#: write error/', 256);
 
 1;
index 7ff29405bd4efbc2c10ab184c0840d91de5aee7e..20dff09941f4a6831880b73144b27fc86a02d044 100644 (file)
@@ -7,7 +7,7 @@ $details = "DETAILS";
 touch('xxx.c');
 
 # Simple check
-run_make_test('', '-r COMPILE.c=echo xxx.o',
+run_make_test("\n", '-r COMPILE.c=echo xxx.o',
               "#MAKE#: *** No rule to make target 'xxx.o'.  Stop.", 512);
 
 # Make sure we can set it from within the makefile too