xref: /freebsd/contrib/bmake/unit-tests/directive-dinclude.mk (revision 24e4dcf4ba5e9dedcf89efd358ea3e1fe5867020)
1# $NetBSD: directive-dinclude.mk,v 1.5 2025/06/28 22:39:28 rillig Exp $
2#
3# Tests for the .dinclude directive, which includes another file,
4# silently skipping it if it cannot be opened.  This is primarily used for
5# including '.depend' files, that's where the 'd' comes from.
6#
7# The 'silently skipping' only applies to the case where the file cannot be
8# opened.  Parse errors and other errors are handled the same way as in the
9# other .include directives.
10
11# No complaint that there is no such file.
12.dinclude "${.CURDIR}/directive-dinclude-nonexistent.inc"
13
14# No complaint either, even though the operating system error is ENOTDIR, not
15# ENOENT.
16.dinclude "${MAKEFILE}/subdir"
17
18# Errors that are not related to opening the file are still reported.
19# expect: make: directive-dinclude-error.inc:1: Invalid line "syntax error"
20_!=	echo 'syntax error' > directive-dinclude-error.inc
21.dinclude "${.CURDIR}/directive-dinclude-error.inc"
22_!=	rm directive-dinclude-error.inc
23
24all: .PHONY
25