Home | History | Annotate | Line # | Download | only in unit-tests
directive-dinclude.mk revision 1.3.2.1
      1 # $NetBSD: directive-dinclude.mk,v 1.3.2.1 2025/08/02 05:58:33 perseant 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: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 
     24 all: .PHONY
     25