xref: /freebsd/contrib/bmake/unit-tests/directive-dinclude.mk (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1# $NetBSD: directive-dinclude.mk,v 1.2 2022/01/23 21:48:59 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 type
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