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 test for .CURDIR from ...
details: https://anonhg.NetBSD.org/src/rev/a13aa95fcf3e
branches: trunk
changeset: 1014957:a13aa95fcf3e
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Oct 08 19:09:08 2020 +0000
description:
make(1): move test for .CURDIR from misc.mk to varname-dot-curname.mk
diffstat:
distrib/sets/lists/tests/mi | 6 +++---
usr.bin/make/unit-tests/misc.exp | 1 -
usr.bin/make/unit-tests/misc.mk | 16 ----------------
usr.bin/make/unit-tests/varname-dot-curdir.mk | 26 ++++++++++++++++++++++----
4 files changed, 25 insertions(+), 24 deletions(-)
diffs (79 lines):
diff -r f6b3f8a2c361 -r a13aa95fcf3e distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Thu Oct 08 18:37:26 2020 +0000
+++ b/distrib/sets/lists/tests/mi Thu Oct 08 19:09:08 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.938 2020/10/04 06:53:15 rillig Exp $
+# $NetBSD: mi,v 1.939 2020/10/08 19:09:08 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4829,8 +4829,8 @@
./usr/tests/usr.bin/make/unit-tests/lint.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/make-exported.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/make-exported.mk tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/make/unit-tests/misc.exp tests-usr.bin-tests compattestfile,atf
-./usr/tests/usr.bin/make/unit-tests/misc.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/misc.exp tests-obsolete obsolete
+./usr/tests/usr.bin/make/unit-tests/misc.mk tests-obsolete obsolete
./usr/tests/usr.bin/make/unit-tests/moderrs.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/moderrs.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/modmatch.exp tests-usr.bin-tests compattestfile,atf
diff -r f6b3f8a2c361 -r a13aa95fcf3e usr.bin/make/unit-tests/misc.exp
--- a/usr.bin/make/unit-tests/misc.exp Thu Oct 08 18:37:26 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-exit status 0
diff -r f6b3f8a2c361 -r a13aa95fcf3e usr.bin/make/unit-tests/misc.mk
--- a/usr.bin/make/unit-tests/misc.mk Thu Oct 08 18:37:26 2020 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-# $Id: misc.mk,v 1.1 2014/08/21 13:44:51 apb Exp $
-
-.if !exists(${.CURDIR}/)
-.warning ${.CURDIR}/ doesn't exist ?
-.endif
-
-.if !exists(${.CURDIR}/.)
-.warning ${.CURDIR}/. doesn't exist ?
-.endif
-
-.if !exists(${.CURDIR}/..)
-.warning ${.CURDIR}/.. doesn't exist ?
-.endif
-
-all:
- @: all is well
diff -r f6b3f8a2c361 -r a13aa95fcf3e usr.bin/make/unit-tests/varname-dot-curdir.mk
--- a/usr.bin/make/unit-tests/varname-dot-curdir.mk Thu Oct 08 18:37:26 2020 +0000
+++ b/usr.bin/make/unit-tests/varname-dot-curdir.mk Thu Oct 08 19:09:08 2020 +0000
@@ -1,8 +1,26 @@
-# $NetBSD: varname-dot-curdir.mk,v 1.6 2020/10/05 19:27:48 rillig Exp $
+# $NetBSD: varname-dot-curdir.mk,v 1.7 2020/10/08 19:09:08 rillig Exp $
+#
+# Tests for the special .CURDIR variable, which is initially set to the
+# canonical path of the current working directory, when make started.
+
+# In all normal situations, the current directory exists, and its name can
+# be resolved. If not, make fails at startup.
#
-# Tests for the special .CURDIR variable.
-
-# TODO: Implementation
+# It would be possible on some systems to remove the current directory, even
+# while a process runs in it, but this is so unrealistic that it's no worth
+# testing.
+.if !exists(${.CURDIR})
+. error
+.endif
+.if !exists(${.CURDIR}/)
+. error
+.endif
+.if !exists(${.CURDIR}/.)
+. error
+.endif
+.if !exists(${.CURDIR}/..)
+. error
+.endif
# Until 2020-10-04, assigning the result of a shell assignment to .CURDIR
# tried to add the shell command ("echo /") to the .PATH instead of the
Home |
Main Index |
Thread Index |
Old Index