Module Name: src
Committed By: rillig
Date: Sun Aug 23 15:13:22 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: modmisc.exp modmisc.mk varmod-hash.exp
varmod-hash.mk varmod-localtime.exp varmod-localtime.mk
varmod-range.exp varmod-range.mk
Log Message:
make(1): move tests for :hash :range :localtime into separate files
To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/make/unit-tests/modmisc.exp \
src/usr.bin/make/unit-tests/modmisc.mk
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/varmod-hash.exp \
src/usr.bin/make/unit-tests/varmod-localtime.exp \
src/usr.bin/make/unit-tests/varmod-range.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-hash.mk \
src/usr.bin/make/unit-tests/varmod-localtime.mk \
src/usr.bin/make/unit-tests/varmod-range.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/modmisc.exp
diff -u src/usr.bin/make/unit-tests/modmisc.exp:1.44 src/usr.bin/make/unit-tests/modmisc.exp:1.45
--- src/usr.bin/make/unit-tests/modmisc.exp:1.44 Sun Aug 23 15:09:15 2020
+++ src/usr.bin/make/unit-tests/modmisc.exp Sun Aug 23 15:13:21 2020
@@ -21,25 +21,4 @@ line
mod-break-many-words: 500
mod-remember: 1 2 3 1 2 3 1 2 3
mod-remember: 1 2 3, SAVED=3
-mod-localtime:
-%Y
-2020
-%Y
-mod-hash:
-make: Unknown modifier 'h'
-
-26bb0f5f
-12345
-make: Unknown modifier 'h'
-
-make: Unknown modifier 'h'
-
-mod-range:
-make: Unknown modifier 'r'
-
-1 2 3
-make: Unknown modifier 'r'
-
-make: Unknown modifier 'r'
-
exit status 0
Index: src/usr.bin/make/unit-tests/modmisc.mk
diff -u src/usr.bin/make/unit-tests/modmisc.mk:1.44 src/usr.bin/make/unit-tests/modmisc.mk:1.45
--- src/usr.bin/make/unit-tests/modmisc.mk:1.44 Sun Aug 23 15:09:15 2020
+++ src/usr.bin/make/unit-tests/modmisc.mk Sun Aug 23 15:13:21 2020
@@ -1,4 +1,4 @@
-# $Id: modmisc.mk,v 1.44 2020/08/23 15:09:15 rillig Exp $
+# $Id: modmisc.mk,v 1.45 2020/08/23 15:13:21 rillig Exp $
#
# miscellaneous modifier tests
@@ -20,9 +20,6 @@ all: mod-tu-space
all: mod-quote
all: mod-break-many-words
all: mod-remember
-all: mod-localtime
-all: mod-hash
-all: mod-range
# See also sysv.mk.
modsysv:
@@ -82,27 +79,6 @@ mod-remember:
@echo $@: ${1 2 3:L:_:@var@${_}@}
@echo $@: ${1 2 3:L:@var@${var:_=SAVED:}@}, SAVED=${SAVED}
-mod-localtime:
- @echo $@:
- @echo ${%Y:L:localtim=1593536400} # modifier name too short
- @echo ${%Y:L:localtime=1593536400} # 2020-07-01T00:00:00Z
- @echo ${%Y:L:localtimer=1593536400} # modifier name too long
-
-mod-hash:
- @echo $@:
- @echo ${12345:L:has} # modifier name too short
- @echo ${12345:L:hash} # ok
- @echo ${12345:L:hash=SHA-256} # :hash does not accept '='
- @echo ${12345:L:hasX} # misspelled
- @echo ${12345:L:hashed} # modifier name too long
-
-mod-range:
- @echo $@:
- @echo ${a b c:L:rang} # modifier name too short
- @echo ${a b c:L:range} # ok
- @echo ${a b c:L:rango} # misspelled
- @echo ${a b c:L:ranger} # modifier name too long
-
# To apply a modifier indirectly via another variable, the whole
# modifier must be put into a single variable.
.if ${value:L:${:US}${:U,value,replacement,}} != "S,value,replacement,}"
Index: src/usr.bin/make/unit-tests/varmod-hash.exp
diff -u src/usr.bin/make/unit-tests/varmod-hash.exp:1.1 src/usr.bin/make/unit-tests/varmod-hash.exp:1.2
--- src/usr.bin/make/unit-tests/varmod-hash.exp:1.1 Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/varmod-hash.exp Sun Aug 23 15:13:21 2020
@@ -1 +1,9 @@
+make: Unknown modifier 'h'
+
+26bb0f5f
+12345
+make: Unknown modifier 'h'
+
+make: Unknown modifier 'h'
+
exit status 0
Index: src/usr.bin/make/unit-tests/varmod-localtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-localtime.exp:1.1 src/usr.bin/make/unit-tests/varmod-localtime.exp:1.2
--- src/usr.bin/make/unit-tests/varmod-localtime.exp:1.1 Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/varmod-localtime.exp Sun Aug 23 15:13:21 2020
@@ -1 +1,4 @@
+%Y
+2020
+%Y
exit status 0
Index: src/usr.bin/make/unit-tests/varmod-range.exp
diff -u src/usr.bin/make/unit-tests/varmod-range.exp:1.1 src/usr.bin/make/unit-tests/varmod-range.exp:1.2
--- src/usr.bin/make/unit-tests/varmod-range.exp:1.1 Sun Aug 16 12:07:51 2020
+++ src/usr.bin/make/unit-tests/varmod-range.exp Sun Aug 23 15:13:21 2020
@@ -1 +1,8 @@
+make: Unknown modifier 'r'
+
+1 2 3
+make: Unknown modifier 'r'
+
+make: Unknown modifier 'r'
+
exit status 0
Index: src/usr.bin/make/unit-tests/varmod-hash.mk
diff -u src/usr.bin/make/unit-tests/varmod-hash.mk:1.2 src/usr.bin/make/unit-tests/varmod-hash.mk:1.3
--- src/usr.bin/make/unit-tests/varmod-hash.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/varmod-hash.mk Sun Aug 23 15:13:21 2020
@@ -1,8 +1,10 @@
-# $NetBSD: varmod-hash.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-hash.mk,v 1.3 2020/08/23 15:13:21 rillig Exp $
#
# Tests for the :hash variable modifier.
-# TODO: Implementation
-
all:
- @:;
+ @echo ${12345:L:has} # modifier name too short
+ @echo ${12345:L:hash} # ok
+ @echo ${12345:L:hash=SHA-256} # :hash does not accept '='
+ @echo ${12345:L:hasX} # misspelled
+ @echo ${12345:L:hashed} # modifier name too long
Index: src/usr.bin/make/unit-tests/varmod-localtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-localtime.mk:1.2 src/usr.bin/make/unit-tests/varmod-localtime.mk:1.3
--- src/usr.bin/make/unit-tests/varmod-localtime.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/varmod-localtime.mk Sun Aug 23 15:13:21 2020
@@ -1,9 +1,9 @@
-# $NetBSD: varmod-localtime.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-localtime.mk,v 1.3 2020/08/23 15:13:21 rillig Exp $
#
# Tests for the :localtime variable modifier, which returns the given time,
# formatted as a local timestamp.
-# TODO: Implementation
-
all:
- @:;
+ @echo ${%Y:L:localtim=1593536400} # modifier name too short
+ @echo ${%Y:L:localtime=1593536400} # 2020-07-01T00:00:00Z
+ @echo ${%Y:L:localtimer=1593536400} # modifier name too long
Index: src/usr.bin/make/unit-tests/varmod-range.mk
diff -u src/usr.bin/make/unit-tests/varmod-range.mk:1.2 src/usr.bin/make/unit-tests/varmod-range.mk:1.3
--- src/usr.bin/make/unit-tests/varmod-range.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/varmod-range.mk Sun Aug 23 15:13:21 2020
@@ -1,9 +1,10 @@
-# $NetBSD: varmod-range.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-range.mk,v 1.3 2020/08/23 15:13:21 rillig Exp $
#
# Tests for the :range variable modifier, which generates sequences
# of integers from the given range.
-# TODO: Implementation
-
all:
- @:;
+ @echo ${a b c:L:rang} # modifier name too short
+ @echo ${a b c:L:range} # ok
+ @echo ${a b c:L:rango} # misspelled
+ @echo ${a b c:L:ranger} # modifier name too long