Add a test for another (still open) bug.
authorPaul Smith <psmith@gnu.org>
Sun, 4 Oct 2009 19:18:16 +0000 (19:18 +0000)
committerPaul Smith <psmith@gnu.org>
Sun, 4 Oct 2009 19:18:16 +0000 (19:18 +0000)
tests/ChangeLog
tests/scripts/features/parallelism

index aeee9b478a490867061fa7ee49f5722240d4bc5d..b9c3d47974319647e747b6c5ff87b937616817a8 100644 (file)
@@ -1,5 +1,7 @@
 2009-10-03  Paul Smith  <psmith@gnu.org>
 
+       * scripts/features/parallelism: Test for open Savannah bug #26846.
+
        * scripts/variables/MAKE: Rewrite for new run_make_test() format.
 
        * scripts/variables/MAKEFLAGS: Created.
index bce743c4bdc8a3e314ae69c3b93f28b163216349..8bf24a41e1cafb931d52a5dc20951d2b695648ed 100644 (file)
@@ -43,7 +43,7 @@ all: 1 2; \@echo success
               "-j4",
               "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
 
-unlink('1.inc', '2.inc');
+rmfiles(qw(1.inc 2.inc));
 
 
 # Test parallelism with included files--this time recurse first and make
@@ -62,7 +62,7 @@ endif
               "-j4",
               "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n");
 
-unlink('1.inc', '2.inc');
+rmfiles(qw(1.inc 2.inc));
 
 # Grant Taylor reports a problem where tokens can be lost (not written back
 # to the pipe when they should be): this happened when there is a $(shell ...)
@@ -138,7 +138,7 @@ intermed: | phony ; touch $@
 
 .PHONY: phony
 phony: ; : phony', '-rR -j', ': phony');
-unlink('target');
+rmfiles('target');
 
 # TEST #10: Don't put --jobserver-fds into a re-exec'd MAKEFLAGS.
 # We can't test this directly because there's no way a makefile can
@@ -162,7 +162,37 @@ inc.mk:
 !,
               '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
 
-unlink('inc.mk');
+rmfiles('inc.mk');
+
+if ($all_tests) {
+    # Implicit files aren't properly recreated during parallel builds
+    # Savannah bug #26864
+
+    # The first run works fine
+    run_make_test(q!
+%.bar: %.x foo.y ; cat $^ > $@
+%.x: ; touch $@
+foo.y: foo.y.in ; cp $< $@
+foo.y.in: ; touch $@
+!,
+                  '-j2 main.bar',
+                  "touch foo.y.in
+touch main.x
+cp foo.y.in foo.y
+cat main.x foo.y > main.bar
+rm main.x");
+
+    # Now we touch the .in file and make sure it still works
+    touch('foo.y.in');
+
+    run_make_test(undef, '-j2 main.bar', "cp foo.y.in foo.y
+touch main.x
+cat main.x foo.y > main.bar
+rm main.x");
+
+    # Clean up
+    rmfiles(qw(foo.y foo.y.in main.bar));
+}
 
 # Make sure that all jobserver FDs are closed if we need to re-exec the
 # master copy.
@@ -191,12 +221,12 @@ unlink('inc.mk');
 #               '-j2 INCL=false fdprint',
 #               'bar');
 
-# unlink('dependfile', 'output');
+# rmfiles(qw(dependfile output));
 
 
 # # Do it again, this time where the include is done by the non-master make.
 # run_make_test(undef, '-j2 recurse INCL=false', 'bar');
 
-# unlink('dependfile', 'output');
+# rmfiles(qw(dependfile output));
 
 1;