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