Module Name: src
Committed By: rillig
Date: Thu Oct 29 18:59:43 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: varmod-gmtime.mk
Log Message:
make(1): add test for default time format of the :gmtime modifier
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/varmod-gmtime.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/varmod-gmtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.2 src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.3
--- src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.2 Sun Aug 16 12:48:55 2020
+++ src/usr.bin/make/unit-tests/varmod-gmtime.mk Thu Oct 29 18:59:43 2020
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-gmtime.mk,v 1.2 2020/08/16 12:48:55 rillig Exp $
+# $NetBSD: varmod-gmtime.mk,v 1.3 2020/10/29 18:59:43 rillig Exp $
#
# Tests for the :gmtime variable modifier, which formats a timestamp
# using strftime(3).
@@ -6,6 +6,14 @@
all: mod-gmtime
all: mod-gmtime-indirect
+# Test for the default time format, %c. Since the time always varies, it's
+# only possible to check for the general format here. The names of the
+# month and weekday are always in English, independent from the locale.
+# Example: Thu Oct 29 18:56:41 2020
+.if ${:U:gmtime:tW:M??? ??? ?? ??\:??\:?? ????} == ""
+. error
+.endif
+
mod-gmtime:
@echo $@:
@echo ${%Y:L:gmtim=1593536400} # modifier name too short