Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/make/unit-tests tests/make: test how '$' behaves in ...
details: https://anonhg.NetBSD.org/src/rev/515c8f8fa4a3
branches: trunk
changeset: 373707:515c8f8fa4a3
user: rillig <rillig%NetBSD.org@localhost>
date: Sat Feb 25 00:09:52 2023 +0000
description:
tests/make: test how '$' behaves in .MAKEOVERRIDES and MAKEFLAGS
diffstat:
usr.bin/make/unit-tests/varname-dot-makeoverrides.exp | 4 ++++
usr.bin/make/unit-tests/varname-dot-makeoverrides.mk | 18 ++++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diffs (35 lines):
diff -r bef9cd41b4fa -r 515c8f8fa4a3 usr.bin/make/unit-tests/varname-dot-makeoverrides.exp
--- a/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp Sat Feb 25 00:07:08 2023 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-makeoverrides.exp Sat Feb 25 00:09:52 2023 +0000
@@ -1,1 +1,5 @@
+make -r -f varname-dot-makeoverrides.mk dollars_stage_2 DOLLARS='$${varname}'
+stage 2: dollars=<${varname}>
+make -r -f varname-dot-makeoverrides.mk dollars_stage_3
+stage 3: dollars=<>
exit status 0
diff -r bef9cd41b4fa -r 515c8f8fa4a3 usr.bin/make/unit-tests/varname-dot-makeoverrides.mk
--- a/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk Sat Feb 25 00:07:08 2023 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-makeoverrides.mk Sat Feb 25 00:09:52 2023 +0000
@@ -1,8 +1,18 @@
-# $NetBSD: varname-dot-makeoverrides.mk,v 1.3 2023/02/15 06:52:59 rillig Exp $
+# $NetBSD: varname-dot-makeoverrides.mk,v 1.4 2023/02/25 00:09:52 rillig Exp $
#
# Tests for the special .MAKEOVERRIDES variable.
-# TODO: Implementation
+all:
+ @${MAKE} -r -f ${MAKEFILE} dollars_stage_1
-all:
- @:;
+# Demonstrate that '$' characters are altered when they are passed on to child
+# make processes via .MAKEOVERRIDES and MAKEFLAGS.
+dollars_stage_1:
+ ${MAKE} -r -f ${MAKEFILE} dollars_stage_2 DOLLARS='$$$${varname}'
+
+dollars_stage_2:
+ @echo 'stage 2: dollars=<${DOLLARS}>'
+ ${MAKE} -r -f ${MAKEFILE} dollars_stage_3
+
+dollars_stage_3:
+ @echo 'stage 3: dollars=<${DOLLARS}>'
Home |
Main Index |
Thread Index |
Old Index