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 tests/make: add test for circular de...
details: https://anonhg.NetBSD.org/src/rev/4dd8ad9db8d1
branches: trunk
changeset: 984007:4dd8ad9db8d1
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Jun 17 15:25:33 2021 +0000
description:
tests/make: add test for circular dependency in .ORDER
diffstat:
usr.bin/make/unit-tests/deptgt-order.exp | 3 +++
usr.bin/make/unit-tests/deptgt-order.mk | 18 ++++++++++++++----
2 files changed, 17 insertions(+), 4 deletions(-)
diffs (34 lines):
diff -r 8e2cbbfd974c -r 4dd8ad9db8d1 usr.bin/make/unit-tests/deptgt-order.exp
--- a/usr.bin/make/unit-tests/deptgt-order.exp Thu Jun 17 12:53:43 2021 +0000
+++ b/usr.bin/make/unit-tests/deptgt-order.exp Thu Jun 17 15:25:33 2021 +0000
@@ -1,1 +1,4 @@
+: 'Making two out of one.'
+: 'Making three out of two.'
+: 'Making all out of three.'
exit status 0
diff -r 8e2cbbfd974c -r 4dd8ad9db8d1 usr.bin/make/unit-tests/deptgt-order.mk
--- a/usr.bin/make/unit-tests/deptgt-order.mk Thu Jun 17 12:53:43 2021 +0000
+++ b/usr.bin/make/unit-tests/deptgt-order.mk Thu Jun 17 15:25:33 2021 +0000
@@ -1,8 +1,18 @@
-# $NetBSD: deptgt-order.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: deptgt-order.mk,v 1.3 2021/06/17 15:25:33 rillig Exp $
#
# Tests for the special target .ORDER in dependency declarations.
-# TODO: Implementation
+all one two three: .PHONY
+
+two: one
+ : 'Making $@ out of $>.'
+three: two
+ : 'Making $@ out of $>.'
-all:
- @:;
+# This .ORDER creates a circular dependency since 'three' depends on 'one'
+# but 'one' is supposed to be built after 'three'.
+.ORDER: three one
+
+# XXX: The circular dependency should be detected here.
+all: three
+ : 'Making $@ out of $>.'
Home |
Main Index |
Thread Index |
Old Index