From 300d1296fb0f8f1b6bd16f977e2167442338343d Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 21 Sep 2013 18:10:08 -0400 Subject: Create a target that tests alternative configurations. --- tests/ChangeLog | 10 +++++++ tests/scripts/features/jobserver | 59 ++++++++++++++++++++++++++++++++++++++ tests/scripts/features/output-sync | 9 ++++-- tests/scripts/features/parallelism | 44 ---------------------------- tests/scripts/features/se_explicit | 5 +++- 5 files changed, 79 insertions(+), 48 deletions(-) create mode 100644 tests/scripts/features/jobserver (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index cbcaa03..fee01a8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,15 @@ 2013-09-21 Paul Smith + * 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 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 < $@ -!, - '--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 <