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 the :O and :...
details: https://anonhg.NetBSD.org/src/rev/d7f49ce57e93
branches: trunk
changeset: 942710:d7f49ce57e93
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Aug 16 20:13:10 2020 +0000
description:
make(1): move tests for the :O and :Or modifiers into separate files
diffstat:
usr.bin/make/unit-tests/modorder.exp | 3 ---
usr.bin/make/unit-tests/modorder.mk | 5 +----
usr.bin/make/unit-tests/varmod-order-reverse.mk | 8 ++++++--
usr.bin/make/unit-tests/varmod-order.mk | 10 +++++++---
4 files changed, 14 insertions(+), 12 deletions(-)
diffs (68 lines):
diff -r e7d8db7613d5 -r d7f49ce57e93 usr.bin/make/unit-tests/modorder.exp
--- a/usr.bin/make/unit-tests/modorder.exp Sun Aug 16 20:04:36 2020 +0000
+++ b/usr.bin/make/unit-tests/modorder.exp Sun Aug 16 20:13:10 2020 +0000
@@ -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
diff -r e7d8db7613d5 -r d7f49ce57e93 usr.bin/make/unit-tests/modorder.mk
--- a/usr.bin/make/unit-tests/modorder.mk Sun Aug 16 20:04:36 2020 +0000
+++ b/usr.bin/make/unit-tests/modorder.mk Sun Aug 16 20:13:10 2020 +0000
@@ -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 @@
# 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
diff -r e7d8db7613d5 -r d7f49ce57e93 usr.bin/make/unit-tests/varmod-order-reverse.mk
--- a/usr.bin/make/unit-tests/varmod-order-reverse.mk Sun Aug 16 20:04:36 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-order-reverse.mk Sun Aug 16 20:13:10 2020 +0000
@@ -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:
@:;
diff -r e7d8db7613d5 -r d7f49ce57e93 usr.bin/make/unit-tests/varmod-order.mk
--- a/usr.bin/make/unit-tests/varmod-order.mk Sun Aug 16 20:04:36 2020 +0000
+++ b/usr.bin/make/unit-tests/varmod-order.mk Sun Aug 16 20:13:10 2020 +0000
@@ -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:
@:;
Home |
Main Index |
Thread Index |
Old Index