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: fix test for option '-q'...



details:   https://anonhg.NetBSD.org/src/rev/5e1ffbf618b0
branches:  trunk
changeset: 369450:5e1ffbf618b0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 18 05:37:05 2022 +0000

description:
tests/make: fix test for option '-q' in ATF mode

When running 'make test' in usr.bin/make, MAKE is set to '$PWD/make',
and when that file is used as a dependency, everything works as
expected.

When running the tests via ATF, MAKE is set to simply 'make', based on
argv[0].  Using 'make' as a dependency searches in the current directory
but not in /usr/bin, so the file is not found, which makes the
"up-to-date" target out of date.

Switch the dependeny from ${MAKE} to ${MAKEFILE}, as that file does not
involve any $PATH magic and is also guaranteed to be older than the
'up-to-date' file that is created while running the test.

diffstat:

 usr.bin/make/unit-tests/opt-query.mk |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r ad4cc467dd05 -r 5e1ffbf618b0 usr.bin/make/unit-tests/opt-query.mk
--- a/usr.bin/make/unit-tests/opt-query.mk      Wed Aug 17 23:36:48 2022 +0000
+++ b/usr.bin/make/unit-tests/opt-query.mk      Thu Aug 18 05:37:05 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: opt-query.mk,v 1.6 2022/08/17 20:10:29 rillig Exp $
+# $NetBSD: opt-query.mk,v 1.7 2022/08/18 05:37:05 rillig Exp $
 #
 # Tests for the -q command line option.
 #
@@ -76,8 +76,8 @@
 
 .elif ${PART} == "variants"
 
-opt-query-file.out-of-date: ${MAKE}
-opt-query-file.up-to-date: ${MAKE}
+opt-query-file.out-of-date: ${MAKEFILE}
+opt-query-file.up-to-date: ${MAKEFILE}
 phony: .PHONY
 
 .else



Home | Main Index | Thread Index | Old Index