diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-02-18 13:59:26 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-02-18 23:12:30 +0100 |
commit | e1606b320367120dbd9353913bb6f5bf3260c14e (patch) | |
tree | 2a6ce8f39d3588e537cdc496093d17030cc08697 /lib/am/check2.am | |
parent | 21af8bfd077dad5411ba07bd2208b6d216ad686f (diff) | |
download | automake-e1606b320367120dbd9353913bb6f5bf3260c14e.tar.gz |
parallel-tests: fix another BSD parallel make issue
When BSD make is run in parallel mode, it apparently strips any
leading directory component from the automatic variable '$*' (of
course, against what POSIX mandates). This was causing FreeBSD 9.0
make and NetBSD 5.1 make to spuriously fail with automake-generated
test harnesses if subdir tests were present *and* make was being
run in parallel mode. This issue affected also the Automake own
testsuite.
* lib/am/check2.am (am__set_b): New internal variable.
(%OBJ%, %EXT%.log, %EXT%$(EXEEXT).log): Use it to work around
the described BSD make issue.
* tests/parallel-tests3.test: Enhanced to expose the bug.
* tests/parallel-tests-subdir.test: Enhance a little, since we
are at it.
* NEWS: Update.
Diffstat (limited to 'lib/am/check2.am')
-rw-r--r-- | lib/am/check2.am | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/lib/am/check2.am b/lib/am/check2.am index a14e775cd..9847a449f 100644 --- a/lib/am/check2.am +++ b/lib/am/check2.am @@ -14,11 +14,32 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see <http://www.gnu.org/licenses/>. +if %?FIRST% +## When BSD make is run in parallel mode, it apparently strips any +## leading directory component from the automatic variable '$*' (of +## course, against what POSIX mandates). Try to detect and work +## around this incompatibility. +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +endif %?FIRST% + ## From a test file to a .log and .trs file. ?GENERIC?%EXT%.log: ?!GENERIC?%OBJ%: %SOURCE% - @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \ - --log-file '%BASE%.log' --trs-file '%BASE%.trs' \ + @p='%SOURCE%'; \ +## Another hack to support BSD make in parallel mode. +?!GENERIC? b='%BASE%'; \ +?GENERIC? $(am__set_b); \ + $(am__check_pre) %DRIVER% --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \ "$$tst" $(AM_TESTS_FD_REDIRECT) @@ -28,8 +49,12 @@ ## conflict with the previous one. if %am__EXEEXT% ?GENERIC?%EXT%$(EXEEXT).log: - @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \ - --log-file '%BASE%.log' --trs-file '%BASE%.trs' \ + @p='%SOURCE%'; \ + ## Another hack to support BSD make in parallel mode. +?!GENERIC? b='%BASE%'; \ +?GENERIC? $(am__set_b); \ + $(am__check_pre) %DRIVER% --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \ "$$tst" $(AM_TESTS_FD_REDIRECT) endif %am__EXEEXT% |