xref: /freebsd/contrib/bmake/unit-tests/directive-dinclude.mk (revision e1c4c8dd8d2d10b6104f06856a77bd5b4813a801)
1# $NetBSD: directive-dinclude.mk,v 1.3 2023/08/19 10:52:13 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" line 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