freebsd-nq/contrib/bmake/unit-tests/directive-for-null.mk
Simon J. Gerraty 06b9b3e0ad Merge bmake-20210110
Quite a lot of churn on style, but lots of
good work refactoring complicated functions
and lots more unit-tests.
Thanks mostly to rillig at NetBSD

Some interesting entries from ChangeLog

o .MAKE.{UID,GID} represent uid and gid running make.

o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o add more unit tests for META MODE

Merge commit '8e11a9b4250be3c3379c45fa820bff78d99d5946' into main

Change-Id: I464fd4c013067f0915671c1ccc96d2d8090b2b9c
2021-01-13 22:21:37 -08:00

20 lines
719 B
Makefile

# $NetBSD: directive-for-null.mk,v 1.1 2020/12/19 16:00:17 rillig Exp $
#
# Test for parsing a .for loop that accidentally contains a null byte.
#
# As of 2020-12-19, there are 3 error messages:
#
# make: "(stdin)" line 2: Zero byte read from file
# make: "(stdin)" line 2: Unexpected end of file in for loop.
# make: "(stdin)" line 3: Zero byte read from file
#
# The one about "end of file" might be misleading but is due to the
# implementation. On both errors and EOF, ParseGetLine returns NULL.
#
# The one about the "zero byte" in line 3 is surprising since the only
# line that contains a null byte is line 2.
all: .PHONY
@printf '%s\n' '.for i in 1 2 3' 'VAR=value' '.endfor' | tr 'l' '\0' \
| ${MAKE} -f -