Create a target that tests alternative configurations.
authorPaul Smith <psmith@gnu.org>
Sat, 21 Sep 2013 22:10:08 +0000 (18:10 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 21 Sep 2013 22:10:08 +0000 (18:10 -0400)
ChangeLog
maintMakefile
tests/ChangeLog
tests/scripts/features/jobserver [new file with mode: 0644]
tests/scripts/features/output-sync
tests/scripts/features/parallelism
tests/scripts/features/se_explicit

index 5adb84c9406b0dd20b2acf6bff41d34224d63c35..7db09104361de5b2a73e57ba350a76c65a000f02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2013-09-21  Paul Smith  <psmith@gnu.org>
 
+       * maintMakefile (check-alt-config): Create a target to test
+       alternative configurations.  Each one will build make with a
+       different configuration then run the test suite.
+
        Invert the output-sync #define to NO_OUTPUT_SYNC
 
        * configure.ac: Don't set OUTPUT_SYNC.
index e3eda377e3b13c019e465d523b8277f9f3eef7a8..1836629f2cfc6c0dbf9120a9da4c5d93cd9bef28 100644 (file)
@@ -184,10 +184,41 @@ scm-update: get-config/texinfo.tex get-config/config.guess get-config/config.sub
 update: po-update scm-update
 
 
+# ---------------------------------- #
+# Alternative configuration checks.  #
+# ---------------------------------- #
+
+.PHONY: check-alt-config
+check-alt-config: \
+       checkcfg.--disable-job-server \
+       checkcfg.--disable-load \
+       checkcfg.--without-guile \
+       checkcfg.CPPFLAGS^-DNO_OUTPUT_SYNC \
+       checkcfg.CPPFLAGS^-DNO_ARCHIVES
+
+checkcfg.%: distdir
+       @  rm -rf $(distdir)/_build \
+       && mkdir $(distdir)/_build \
+       && cd $(distdir)/_build \
+       && echo "Testing configure with $(subst ^,=,$*)" \
+       && ../configure --srcdir=.. $(subst ^,=,$*) \
+               $(AM_DISTCHECK_CONFIGURE_FLAGS) $(DISTCHECK_CONFIGURE_FLAGS) \
+               CFLAGS='$(AM_CFLAGS)' \
+       && $(MAKE) $(AM_MAKEFLAGS) \
+       && $(MAKE) $(AM_MAKEFLAGS) check
+
+
+.PHONY: update
+update: po-update scm-update
+
+
 ## --------------- ##
 ## Sanity checks.  ##
 ## --------------- ##
 
+# Before we build a distribution be sure we run our local checks
+#distdir: local-check
+
 # Checks that don't require Git.  Run 'changelog-check' last as
 # previous test may reveal problems requiring new ChangeLog entries.
 local-check: po-check changelog-check
index cbcaa0366fca67d3b877801020d04143e63f7f5b..fee01a860084fa9ef5922e04883a9cb732084596 100644 (file)
@@ -1,5 +1,15 @@
 2013-09-21  Paul Smith  <psmith@gnu.org>
 
+       * scripts/features/se_explicit: Fix a test that behaves
+       differently with/without archive capability enabled.
+       * scripts/features/output-sync: Don't test output-sync if it's not
+       enabled.  We also skip it if parallelism is not enabled, although
+       strictly speaking some of the output-sync tests are valid even
+       without parallelism.
+       * scripts/features/jobserver: Move some tests that require the
+       jobserver from features/parallelism to a separate suite.  Only run
+       this if jobserver mode is enabled.
+
        * scripts/features/output-sync: Test shell functions writing to
        stderr in recipes: ensure it's captured via output-sync.  Test
        output generated while reading makefiles and make sure it's
diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver
new file mode 100644 (file)
index 0000000..6a9565e
--- /dev/null
@@ -0,0 +1,59 @@
+#                                                                    -*-perl-*-
+
+$description = "Test jobserver.";
+
+$details = "These tests are ones that specifically are different when the
+jobserver feature is available.  Most -j tests are the same whether or not
+jobserver is available, and those appear in the 'parallelism' test suite.";
+
+exists $FEATURES{'jobserver'} or return -1;
+
+if (!$parallel_jobs) {
+  return -1;
+}
+
+# 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
+# show the value of MAKEFLAGS we were re-exec'd with.  We can intuit it
+# by looking for "disabling jobserver mode" warnings; we should only
+# get one from the original invocation and none from the re-exec.
+# See Savannah bug #18124
+
+run_make_test(q!
+-include inc.mk
+recur:
+#      @echo 'MAKEFLAGS = $(MAKEFLAGS)'
+       @rm -f inc.mk
+       @$(MAKE) -j2 -f #MAKEFILE# all
+all:
+#      @echo 'MAKEFLAGS = $(MAKEFLAGS)'
+       @echo $@
+inc.mk:
+#      @echo 'MAKEFLAGS = $(MAKEFLAGS)'
+       @echo 'FOO = bar' > $@
+!,
+              '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
+
+rmfiles('inc.mk');
+
+# Test recursion when make doesn't think it exists.
+# See Savannah bug #39934
+# Or Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=885474
+
+open(MAKEFILE,"> Makefile2");
+print MAKEFILE <<EOF;
+vpath %.c $ENV{HOME}/
+foo:
+EOF
+close(MAKEFILE);
+
+run_make_test(q!
+default: ; @ #MAKEPATH# -f Makefile2
+!,
+              '-j2 --no-print-directory',
+"#MAKE#[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
+#MAKE#[1]: Nothing to be done for 'foo'.");
+
+unlink('Makefile2');
+
+1;
index 3bb99976e9dbdabdf4c80f6e0d1fc344755c99c8..e2e88a7be6e3db5072bdbd53d6133581177e7428 100644 (file)
@@ -4,9 +4,12 @@ $description = "Test --output-sync (-O) option.";
 
 $details = "Test the synchronization of output from parallel jobs.";
 
-if (!$parallel_jobs) {
-  return -1;
-}
+# If we don't have output sync support, never mind.
+exists $FEATURES{'output-sync'} or return -1;
+
+# Output sync can't be tested without parallelization
+$parallel_jobs or return -1;
+
 
 if ($vos) {
   $sleep_command = "sleep -seconds";
index 084f2cc42f5d50794038c128ca21624a5268fe3b..1f56748436faefb14d6a5449a6ebf1811f2c0656 100644 (file)
@@ -143,30 +143,6 @@ intermed: | phony ; touch $@
 phony: ; : phony', '-rR -j', ': phony');
 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
-# show the value of MAKEFLAGS we were re-exec'd with.  We can intuit it
-# by looking for "disabling jobserver mode" warnings; we should only
-# get one from the original invocation and none from the re-exec.
-# See Savannah bug #18124
-
-run_make_test(q!
--include inc.mk
-recur:
-#      @echo 'MAKEFLAGS = $(MAKEFLAGS)'
-       @rm -f inc.mk
-       @$(MAKE) -j2 -f #MAKEFILE# all
-all:
-#      @echo 'MAKEFLAGS = $(MAKEFLAGS)'
-       @echo $@
-inc.mk:
-#      @echo 'MAKEFLAGS = $(MAKEFLAGS)'
-       @echo 'FOO = bar' > $@
-!,
-              '--no-print-directory -j2', "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
-
-rmfiles('inc.mk');
-
 # TEST #11: Make sure -jN from MAKEFLAGS is processed even when we re-exec
 # See Savannah bug #33873
 
@@ -202,26 +178,6 @@ file2: file1 ; @touch $@
 
 rmfiles('file1', 'file2', 'file3', 'file4');
 
-# Test recursion when make doesn't think it exists.
-# See Savannah bug #39934
-# Or Red Hat bug https://bugzilla.redhat.com/show_bug.cgi?id=885474
-
-open(MAKEFILE,"> Makefile2");
-print MAKEFILE <<EOF;
-vpath %.c $ENV{HOME}/
-foo:
-EOF
-close(MAKEFILE);
-
-run_make_test(q!
-default: ; @ #MAKEPATH# -f Makefile2
-!,
-              '-j2 --no-print-directory',
-"#MAKE#[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
-#MAKE#[1]: Nothing to be done for 'foo'.");
-
-unlink('Makefile2');
-
 # Make sure that all jobserver FDs are closed if we need to re-exec the
 # master copy.
 #
index c3cade4ad8bddb820000d8e9e34d0e50caaae58d..790017af7c3a91cb67a60acf565256cc28e382ba 100644 (file)
@@ -6,6 +6,9 @@ $details = "";
 # TEST #0: Test handing of '$' in prerequisites with and without second
 # expansion.
 
+# If we don't support archives then the prerequisite is different
+my $prereq = exists $FEATURES{'archives'} ? '$' : '$(PRE)';
+
 run_make_test(q!
 ifdef SE
   .SECONDEXPANSION:
@@ -18,7 +21,7 @@ PRE = three four
 .DEFAULT: ; @echo '$@'
 !,
               '',
-              "\$\nbar\$biz\nfoo\$bar : bar\$baz bar\$biz");
+              "$prereq\nbar\$biz\nfoo\$bar : bar\$baz bar\$biz");
 
 run_make_test(undef, 'SE=1', "three\nfour\nbariz\nfoo\$bar : baraz bariz");