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 make(1): move tests for :hash :range...



details:   https://anonhg.NetBSD.org/src/rev/bcbe169be552
branches:  trunk
changeset: 937681:bcbe169be552
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 23 15:13:21 2020 +0000

description:
make(1): move tests for :hash :range :localtime into separate files

diffstat:

 usr.bin/make/unit-tests/modmisc.exp          |  21 ---------------------
 usr.bin/make/unit-tests/modmisc.mk           |  26 +-------------------------
 usr.bin/make/unit-tests/varmod-hash.exp      |   8 ++++++++
 usr.bin/make/unit-tests/varmod-hash.mk       |  10 ++++++----
 usr.bin/make/unit-tests/varmod-localtime.exp |   3 +++
 usr.bin/make/unit-tests/varmod-localtime.mk  |   8 ++++----
 usr.bin/make/unit-tests/varmod-range.exp     |   7 +++++++
 usr.bin/make/unit-tests/varmod-range.mk      |   9 +++++----
 8 files changed, 34 insertions(+), 58 deletions(-)

diffs (162 lines):

diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/modmisc.exp
--- a/usr.bin/make/unit-tests/modmisc.exp       Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.exp       Sun Aug 23 15:13:21 2020 +0000
@@ -21,25 +21,4 @@
 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
diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/modmisc.mk
--- a/usr.bin/make/unit-tests/modmisc.mk        Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/modmisc.mk        Sun Aug 23 15:13:21 2020 +0000
@@ -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-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 @@
        @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,}"
diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/varmod-hash.exp
--- a/usr.bin/make/unit-tests/varmod-hash.exp   Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-hash.exp   Sun Aug 23 15:13:21 2020 +0000
@@ -1,1 +1,9 @@
+make: Unknown modifier 'h'
+
+26bb0f5f
+12345
+make: Unknown modifier 'h'
+
+make: Unknown modifier 'h'
+
 exit status 0
diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/varmod-hash.mk
--- a/usr.bin/make/unit-tests/varmod-hash.mk    Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-hash.mk    Sun Aug 23 15:13:21 2020 +0000
@@ -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
diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/varmod-localtime.exp
--- a/usr.bin/make/unit-tests/varmod-localtime.exp      Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-localtime.exp      Sun Aug 23 15:13:21 2020 +0000
@@ -1,1 +1,4 @@
+%Y
+2020
+%Y
 exit status 0
diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/varmod-localtime.mk
--- a/usr.bin/make/unit-tests/varmod-localtime.mk       Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-localtime.mk       Sun Aug 23 15:13:21 2020 +0000
@@ -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
diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/varmod-range.exp
--- a/usr.bin/make/unit-tests/varmod-range.exp  Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-range.exp  Sun Aug 23 15:13:21 2020 +0000
@@ -1,1 +1,8 @@
+make: Unknown modifier 'r'
+
+1 2 3
+make: Unknown modifier 'r'
+
+make: Unknown modifier 'r'
+
 exit status 0
diff -r b6681e2836c9 -r bcbe169be552 usr.bin/make/unit-tests/varmod-range.mk
--- a/usr.bin/make/unit-tests/varmod-range.mk   Sun Aug 23 15:09:15 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-range.mk   Sun Aug 23 15:13:21 2020 +0000
@@ -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



Home | Main Index | Thread Index | Old Index