summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/features/jobserver59
-rw-r--r--tests/scripts/features/output-sync9
-rw-r--r--tests/scripts/features/parallelism44
-rw-r--r--tests/scripts/features/se_explicit5
4 files changed, 69 insertions, 48 deletions
diff --git a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver
new file mode 100644
index 0000000..6a9565e
--- /dev/null
+++ b/tests/scripts/features/jobserver
@@ -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;
diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync
index 3bb9997..e2e88a7 100644
--- a/tests/scripts/features/output-sync
+++ b/tests/scripts/features/output-sync
@@ -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";
diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
index 084f2cc..1f56748 100644
--- a/tests/scripts/features/parallelism
+++ b/tests/scripts/features/parallelism
@@ -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.
#
diff --git a/tests/scripts/features/se_explicit b/tests/scripts/features/se_explicit
index c3cade4..790017a 100644
--- a/tests/scripts/features/se_explicit
+++ b/tests/scripts/features/se_explicit
@@ -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");