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