Module Name: src
Committed By: rillig
Date: Sun Aug 16 20:13:10 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: modorder.exp modorder.mk
varmod-order-reverse.mk varmod-order.mk
Log Message:
make(1): move tests for the :O and :Or modifiers into separate files
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/modorder.exp \
src/usr.bin/make/unit-tests/varmod-order-reverse.mk \
src/usr.bin/make/unit-tests/varmod-order.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/modorder.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/modorder.exp
diff -u src/usr.bin/make/unit-tests/modorder.exp:1.2 src/usr.bin/make/unit-tests/modorder.exp:1.3
--- src/usr.bin/make/unit-tests/modorder.exp:1.2 Tue Jun 9 01:48:17 2020
+++ src/usr.bin/make/unit-tests/modorder.exp Sun Aug 16 20:13:10 2020
@@ -1,6 +1,3 @@
-LIST = one two three four five six seven eight nine ten
-LIST:O = eight five four nine one seven six ten three two
-LIST:Or = two three ten six seven one nine four five eight
LIST:Ox = Ok
LIST:O:Ox = Ok
LISTX = Ok
Index: src/usr.bin/make/unit-tests/varmod-order-reverse.mk
diff -u src/usr.bin/make/unit-tests/varmod-order-reverse.mk:1.2 src/usr.bin/make/unit-tests/varmod-order-reverse.mk:1.3
--- src/usr.bin/make/unit-tests/varmod-order-reverse.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/varmod-order-reverse.mk Sun Aug 16 20:13:10 2020
@@ -1,9 +1,13 @@
-# $NetBSD: varmod-order-reverse.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-order-reverse.mk,v 1.3 2020/08/16 20:13:10 rillig Exp $
#
# Tests for the :Or variable modifier, which returns the words, sorted in
# descending order.
-# TODO: Implementation
+NUMBERS= one two three four five six seven eight nine ten
+
+.if ${NUMBERS:Or} != "two three ten six seven one nine four five eight"
+.error ${NUMBERS:Or}
+.endif
all:
@:;
Index: src/usr.bin/make/unit-tests/varmod-order.mk
diff -u src/usr.bin/make/unit-tests/varmod-order.mk:1.2 src/usr.bin/make/unit-tests/varmod-order.mk:1.3
--- src/usr.bin/make/unit-tests/varmod-order.mk:1.2 Sun Aug 16 14:25:16 2020
+++ src/usr.bin/make/unit-tests/varmod-order.mk Sun Aug 16 20:13:10 2020
@@ -1,9 +1,13 @@
-# $NetBSD: varmod-order.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: varmod-order.mk,v 1.3 2020/08/16 20:13:10 rillig Exp $
#
-# Tests for the :Or variable modifier, which returns the words, sorted in
+# Tests for the :O variable modifier, which returns the words, sorted in
# ascending order.
-# TODO: Implementation
+NUMBERS= one two three four five six seven eight nine ten
+
+.if ${NUMBERS:O} != "eight five four nine one seven six ten three two"
+.error ${NUMBERS:O}
+.endif
all:
@:;
Index: src/usr.bin/make/unit-tests/modorder.mk
diff -u src/usr.bin/make/unit-tests/modorder.mk:1.3 src/usr.bin/make/unit-tests/modorder.mk:1.4
--- src/usr.bin/make/unit-tests/modorder.mk:1.3 Tue Jun 9 01:48:17 2020
+++ src/usr.bin/make/unit-tests/modorder.mk Sun Aug 16 20:13:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: modorder.mk,v 1.3 2020/06/09 01:48:17 sjg Exp $
+# $NetBSD: modorder.mk,v 1.4 2020/08/16 20:13:10 rillig Exp $
LIST= one two three four five six seven eight nine ten
LISTX= ${LIST:Ox}
@@ -8,9 +8,6 @@ TEST_RESULT= && echo Ok || echo Failed
# unit-tests have to produce the same results on each run
# so we cannot actually include :Ox output.
all:
- @echo "LIST = ${LIST}"
- @echo "LIST:O = ${LIST:O}"
- @echo "LIST:Or = ${LIST:Or}"
# Note that 1 in every 10! trials two independently generated
# randomized orderings will be the same. The test framework doesn't
# support checking probabilistic output, so we accept that each of the