Commit Graph

12 Commits

Author SHA1 Message Date
rillig 518dc17b32 tests/make: test more modifiers and special variables 2024-06-01 18:44:05 +00:00
rillig 873c42efc3 make: provide more context information for parse/evaluate errors 2024-04-20 10:18:55 +00:00
sjg 7106e16450 make: state of save_dollars affects what is a parse error
When save_dollars is false it is not a parse error to
encounter $$ rather than \$.
2024-02-03 00:20:23 +00:00
rillig 1da4da3f90 tests/make: replace 'variable expression' with 'expression'
Each expression is based on a variable, there's no need for the
verbosity.  The wording in make's diagnostics will be changed in a
follow-up commit.
2023-11-19 21:47:52 +00:00
rillig 73d0a5078e tests/make: force line-based diagnostics to be listed in the tests
This way, contradictions between the intended output and the actual
output are closer together and have a better chance of being spotted.
2023-06-01 20:56:35 +00:00
rillig fe11cfee79 tests/make: test misleading error messages on unclosed expressions
The error messages say 'Unknown modifier' or 'Bad modifier', which is
not entirely correct.  The modifier in itself is valid, it's just that
make doesn't expect the end of the string after the modifier.
2022-08-24 21:38:06 +00:00
rillig 7808fd752b tests/make: document parsing behavior of modifiers
The table was created by manually inspecting the code of the various
ApplyModifier functions in var.c.

The modifiers are listed in alphabetical order, except for the SysV
modifier, which is listed at the end since it is used as a fallback
modifier for many other modifiers and because it does not have a fixed
prefix.
2022-08-06 07:06:58 +00:00
rillig ab975bef9f make(1): fix error message for .info/.warning/.error without argument
Previously, the error message was "Unknown directive", which was
obviously wrong.  The new error message is "Missing argument".
2020-12-19 22:33:11 +00:00
rillig d63a8b84ac make(1): add test for the :P modifier, which does not fall back 2020-11-02 17:30:22 +00:00
rillig 173d4ecff3 make(1): in lint mode, complain about erroneous $$
Since 2008-12-21, make has silently ignored strange variable names in
constructs like '$$', '$}', '$' followed by nothing.  Ignoring these
bugs in makefiles instead of reporting them is not a good idea.

To improve the situation, make complains about these errors now, but
only in lint mode (-dL).  This preserves existing behavior while still
allowing to validate existing makefiles that they don't depend on this
bug.

If the test phase goes well, these error messages may be enabled
unconditionally.

https://mail-index.netbsd.org/pkgsrc-users/2020/09/12/msg032229.html
2020-09-13 07:42:20 +00:00
rillig adba330b30 make(1): describe the purpose of each newly added unit test dummy 2020-08-16 14:25:16 +00:00
rillig d126d9d551 make(1): add dummies for fine-grained tests, one per single feature
The test names have been derived from the current manual page.

All these tests are dummies right now, and the code from the existing
tests will be moved into the new tests step by step.

This is done to prevent modmisc, escape, varmod-edge and varmisc from
growing without any bounds, and to reduce the side-effects of one test
to the others.
2020-08-16 12:07:50 +00:00