xref: /freebsd/contrib/bmake/unit-tests/directive-include.mk (revision acb1f1269c6f4ff89a0d28ba742f6687e9ef779d)
1# $NetBSD: directive-include.mk,v 1.5 2020/11/21 14:59:11 rillig Exp $
2#
3# Tests for the .include directive, which includes another file.
4
5# TODO: Implementation
6
7.MAKEFLAGS: -dc
8
9# All included files are recorded in the variable .MAKE.MAKEFILES.
10# In this test, only the basenames of the files are compared since
11# the directories can differ.
12.include "/dev/null"
13.if ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null"
14.  error
15.endif
16
17# Each file is recorded only once in the variable .MAKE.MAKEFILES.
18# Between 2015-11-26 and 2020-10-31, the very last file could be repeated,
19# due to an off-by-one bug in ParseTrackInput.
20.include "/dev/null"
21.if ${.MAKE.MAKEFILES:T} != "${.PARSEFILE} null"
22.  error
23.endif
24
25.include "nonexistent.mk"
26.include "/dev/null"		# size 0
27# including a directory technically succeeds, but shouldn't.
28#.include "."			# directory
29
30# As of 2020-11-21, anything after the delimiter '"' is ignored.
31.include "/dev/null" and ignore anything in the rest of the line.
32
33all:
34	@:;
35