summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2000-07-17 21:40:10 +0000
committerMarc Espie <espie@cvs.openbsd.org>2000-07-17 21:40:10 +0000
commitcdbfc18d352256312e75fe99743ce063ce6721b9 (patch)
treeec6c38c483c0d8d1c97a69429dbd690d8c0f667a /regress
parentac20e26455ceca8ee4dd51f461eb5d1f5d0c451d (diff)
make regression tests.
Some of these we don't even pass, currently.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/make/Makefile47
-rw-r--r--regress/usr.bin/make/mk19
-rw-r--r--regress/usr.bin/make/mk23
-rw-r--r--regress/usr.bin/make/mk2b2
-rw-r--r--regress/usr.bin/make/mk32
-rw-r--r--regress/usr.bin/make/mk3a2
-rw-r--r--regress/usr.bin/make/mk43
-rw-r--r--regress/usr.bin/make/mk4a4
-rw-r--r--regress/usr.bin/make/mk65
-rw-r--r--regress/usr.bin/make/mkfail2
-rw-r--r--regress/usr.bin/make/t2.out1
-rw-r--r--regress/usr.bin/make/t3.out1
-rw-r--r--regress/usr.bin/make/t4.out1
-rw-r--r--regress/usr.bin/make/t6.out1
14 files changed, 83 insertions, 0 deletions
diff --git a/regress/usr.bin/make/Makefile b/regress/usr.bin/make/Makefile
new file mode 100644
index 00000000000..02dcce16f74
--- /dev/null
+++ b/regress/usr.bin/make/Makefile
@@ -0,0 +1,47 @@
+# $OpenBSD: Makefile,v 1.1 2000/07/17 21:40:09 espie Exp $
+
+NOMAN=
+NOPROG=
+
+regress: t1 t2 t3 t4 t5 t6
+
+t1: t1.out
+ env -i PATH=${PATH} ${MAKE} -e -r -f ${.CURDIR}/mk1 | diff - t1.out
+
+
+# This is a POSIX test. pmake does not pass variables to submakes until
+# after OpenBSD 2.7.
+t2:
+ cd ${.CURDIR} && env -i PATH=${PATH} ${MAKE} -r -f mk2| diff - t2.out
+
+t3:
+ cd ${.CURDIR} && env -i PATH=${PATH} ${MAKE} -r -f mk3 -f mk3a|diff - t3.out
+ cd ${.CURDIR} && cat mk3a |env -i PATH=${PATH} ${MAKE} -r -f mk3 -f -|diff - t3.out
+ cd ${.CURDIR} && cat mk3 |env -i PATH=${PATH} ${MAKE} -r -f - -f mk3a|diff - t3.out
+ cd ${.CURDIR} && cat mk3 mk3a|env -i PATH=${PATH} ${MAKE} -r -f - |diff - t3.out
+
+t4:
+ cd ${.CURDIR} && cat mk4 mk4a|env -i PATH=${PATH} ${MAKE} -r -f - |diff - t4.out
+ # Splitting files along conditionals should not work
+ if cd ${.CURDIR} && env -i PATH=${PATH} ${MAKE} -r -f mk4 -f mk4a 2>/dev/null; then false; fi
+
+# Another POSIX test, checking that MAKEFLAGS does work
+t5:
+ # first check that make does fail as expected
+ if cd ${.CURDIR} && env -i PATH=${PATH} ${MAKE} -r -f mkfail 2>/dev/null; then false; fi
+ # first form of MAKEFLAGS
+ cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=-n ${MAKE} -r -f mkfail
+ # second form of MAKEFLAGS
+ cd ${.CURDIR} && env -i PATH=${PATH} MAKEFLAGS=n ${MAKE} -r -f mkfail
+
+t6:
+ cd ${.CURDIR} && env -i PATH=${PATH} ${MAKE} A=good -r -f mk6 | diff - t6.out
+
+t1.out:
+ echo MACHINE_ARCH=${MACHINE_ARCH} >$@
+
+.PHONY: t1 t2 t3 t4 t5 t6 regress
+
+CLEANFILES+=t1.out
+
+.include <bsd.prog.mk>
diff --git a/regress/usr.bin/make/mk1 b/regress/usr.bin/make/mk1
new file mode 100644
index 00000000000..71f807208cf
--- /dev/null
+++ b/regress/usr.bin/make/mk1
@@ -0,0 +1,9 @@
+# invoke with make -r -e
+# if it does NOT return the MACHINE_ARCH, it's buggy
+
+MYARCH:= ${MACHINE_ARCH}
+.if ${MACHINE_ARCH} != "alpha"
+.endif
+
+a:
+ @echo MACHINE_ARCH=${MACHINE_ARCH}
diff --git a/regress/usr.bin/make/mk2 b/regress/usr.bin/make/mk2
new file mode 100644
index 00000000000..452554f2907
--- /dev/null
+++ b/regress/usr.bin/make/mk2
@@ -0,0 +1,3 @@
+# Invoke with make -r
+a:
+ @cd ${.CURDIR} && make -f mk2b COPTS='-g -O2'
diff --git a/regress/usr.bin/make/mk2b b/regress/usr.bin/make/mk2b
new file mode 100644
index 00000000000..37952c0fd10
--- /dev/null
+++ b/regress/usr.bin/make/mk2b
@@ -0,0 +1,2 @@
+a:
+ @echo COPTS=${COPTS}
diff --git a/regress/usr.bin/make/mk3 b/regress/usr.bin/make/mk3
new file mode 100644
index 00000000000..ab38dce6c75
--- /dev/null
+++ b/regress/usr.bin/make/mk3
@@ -0,0 +1,2 @@
+# Check that appending Makefiles work
+A=3
diff --git a/regress/usr.bin/make/mk3a b/regress/usr.bin/make/mk3a
new file mode 100644
index 00000000000..82266b6583e
--- /dev/null
+++ b/regress/usr.bin/make/mk3a
@@ -0,0 +1,2 @@
+a:
+ @echo A=$A
diff --git a/regress/usr.bin/make/mk4 b/regress/usr.bin/make/mk4
new file mode 100644
index 00000000000..b17b5924deb
--- /dev/null
+++ b/regress/usr.bin/make/mk4
@@ -0,0 +1,3 @@
+I=5
+
+.if $I == "5"
diff --git a/regress/usr.bin/make/mk4a b/regress/usr.bin/make/mk4a
new file mode 100644
index 00000000000..3ca523f531d
--- /dev/null
+++ b/regress/usr.bin/make/mk4a
@@ -0,0 +1,4 @@
+.endif
+
+a:
+ @echo I=$I
diff --git a/regress/usr.bin/make/mk6 b/regress/usr.bin/make/mk6
new file mode 100644
index 00000000000..bdc2716f2fd
--- /dev/null
+++ b/regress/usr.bin/make/mk6
@@ -0,0 +1,5 @@
+A=bad
+a:
+.for B in $A
+ @echo $B
+.endfor
diff --git a/regress/usr.bin/make/mkfail b/regress/usr.bin/make/mkfail
new file mode 100644
index 00000000000..0c2c7b2823a
--- /dev/null
+++ b/regress/usr.bin/make/mkfail
@@ -0,0 +1,2 @@
+a:
+ @false
diff --git a/regress/usr.bin/make/t2.out b/regress/usr.bin/make/t2.out
new file mode 100644
index 00000000000..7a5aafc8f07
--- /dev/null
+++ b/regress/usr.bin/make/t2.out
@@ -0,0 +1 @@
+COPTS=-g -O2
diff --git a/regress/usr.bin/make/t3.out b/regress/usr.bin/make/t3.out
new file mode 100644
index 00000000000..8a0c176a260
--- /dev/null
+++ b/regress/usr.bin/make/t3.out
@@ -0,0 +1 @@
+A=3
diff --git a/regress/usr.bin/make/t4.out b/regress/usr.bin/make/t4.out
new file mode 100644
index 00000000000..ea88db4cf63
--- /dev/null
+++ b/regress/usr.bin/make/t4.out
@@ -0,0 +1 @@
+I=5
diff --git a/regress/usr.bin/make/t6.out b/regress/usr.bin/make/t6.out
new file mode 100644
index 00000000000..12799ccbe7c
--- /dev/null
+++ b/regress/usr.bin/make/t6.out
@@ -0,0 +1 @@
+good