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 Add a unit-test for .ORDER
details: https://anonhg.NetBSD.org/src/rev/33abb9e9ac95
branches: trunk
changeset: 782624:33abb9e9ac95
user: sjg <sjg%NetBSD.org@localhost>
date: Fri Nov 09 19:08:28 2012 +0000
description:
Add a unit-test for .ORDER
diffstat:
usr.bin/make/unit-tests/Makefile | 4 +++-
usr.bin/make/unit-tests/order | 20 ++++++++++++++++++++
usr.bin/make/unit-tests/test.exp | 3 +++
3 files changed, 26 insertions(+), 1 deletions(-)
diffs (62 lines):
diff -r 661043b0eb00 -r 33abb9e9ac95 usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile Fri Nov 09 18:53:05 2012 +0000
+++ b/usr.bin/make/unit-tests/Makefile Fri Nov 09 19:08:28 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.34 2012/06/19 23:25:53 sjg Exp $
+# $NetBSD: Makefile,v 1.35 2012/11/09 19:08:28 sjg Exp $
#
# Unit tests for make(1)
# The main targets are:
@@ -36,6 +36,7 @@
modorder \
modts \
modword \
+ order \
phony-end \
posix \
qequals \
@@ -48,6 +49,7 @@
all: ${SUBFILES}
flags.doterror=
+flags.order=-j1
# the tests are actually done with sub-makes.
.PHONY: ${SUBFILES}
diff -r 661043b0eb00 -r 33abb9e9ac95 usr.bin/make/unit-tests/order
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/order Fri Nov 09 19:08:28 2012 +0000
@@ -0,0 +1,20 @@
+# $NetBSD: order,v 1.1 2012/11/09 19:08:28 sjg Exp $
+
+# Test that .ORDER is handled correctly.
+# The explicit dependency the.o: the.h will make us examine the.h
+# the .ORDER will prevent us building it immediately,
+# we should then examine the.c rather than stop.
+
+all: the.o
+
+.ORDER: the.c the.h
+
+the.c the.h:
+ @echo Making $@
+
+.SUFFIXES: .o .c
+
+.c.o:
+ @echo Making $@ from $?
+
+the.o: the.h
diff -r 661043b0eb00 -r 33abb9e9ac95 usr.bin/make/unit-tests/test.exp
--- a/usr.bin/make/unit-tests/test.exp Fri Nov 09 18:53:05 2012 +0000
+++ b/usr.bin/make/unit-tests/test.exp Fri Nov 09 19:08:28 2012 +0000
@@ -310,6 +310,9 @@
LIST:tw:C/ /,/1g="one two three four five six"
LIST:tw:tW:C/ /,/="one,two three four five six"
LIST:tW:tw:C/ /,/="one two three four five six"
+Making the.c
+Making the.h
+Making the.o from the.h the.c
.TARGET="phony" .PREFIX="phony" .IMPSRC=""
.TARGET="all" .PREFIX="all" .IMPSRC=""
.TARGET="ok" .PREFIX="ok" .IMPSRC=""
Home |
Main Index |
Thread Index |
Old Index