aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2022-10-18 15:02:44 +0100
committerRon Yorston <rmy@pobox.com>2022-10-18 15:02:44 +0100
commit3c5b4335d36d2aaa5dadc82b004f43e5a18eddfa (patch)
tree40a5eea86d5d6739b486025cb4437a997c1b9534 /testsuite
parent92a127e9f96598b86a4327b70783b9769eaa94fe (diff)
downloadbusybox-w32-3c5b4335d36d2aaa5dadc82b004f43e5a18eddfa.tar.gz
busybox-w32-3c5b4335d36d2aaa5dadc82b004f43e5a18eddfa.tar.bz2
busybox-w32-3c5b4335d36d2aaa5dadc82b004f43e5a18eddfa.zip
make: shell assignment is a POSIX 202X feature
Austin Group defect report 337 has been accepted, thus making macro assignment from the output of a shell command (!=) a POSIX 202X feature. This was previously implemented as a non-POSIX extension.
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/make.tests23
1 files changed, 12 insertions, 11 deletions
diff --git a/testsuite/make.tests b/testsuite/make.tests
index 67617f8a2..c97950e95 100755
--- a/testsuite/make.tests
+++ b/testsuite/make.tests
@@ -267,6 +267,18 @@ target: file1 file2 file2 file3 file3
267' 267'
268cd .. || exit 1; rm -rf make.tempdir 2>/dev/null 268cd .. || exit 1; rm -rf make.tempdir 2>/dev/null
269 269
270# Assign the output of a shell command to a macro.
271testing "make shell assignment" \
272 "make -f -" \
273 "1 2 3 4\n" "" '
274hello != echo 1; echo 2; echo 3; echo; echo
275
276target:
277 @echo "$(hello) 4"
278'
279
280cd .. || exit 1; rm -rf make.tempdir 2>/dev/null
281
270# Nested macro expansion is allowed. This should be compatible 282# Nested macro expansion is allowed. This should be compatible
271# with other implementations. 283# with other implementations.
272testing "make nested macro expansion" \ 284testing "make nested macro expansion" \
@@ -332,17 +344,6 @@ testing "make chained inference rules" \
332' 344'
333cd .. || exit 1; rm -rf make.tempdir 2>/dev/null 345cd .. || exit 1; rm -rf make.tempdir 2>/dev/null
334 346
335# Assign the output of a shell command to a macro.
336testing "make shell assignment" \
337 "make -f -" \
338 "1 2 3 4\n" "" '
339hello != echo 1; echo 2; echo 3; echo; echo
340
341target:
342 @echo "$(hello) 4"
343'
344
345cd .. || exit 1; rm -rf make.tempdir 2>/dev/null
346# make supports *, ? and [] wildcards in targets and prerequisites 347# make supports *, ? and [] wildcards in targets and prerequisites
347mkdir make.tempdir && cd make.tempdir || exit 1 348mkdir make.tempdir && cd make.tempdir || exit 1
348touch -t 202206171201 t1a t2aa t3b 349touch -t 202206171201 t1a t2aa t3b