Commit Graph

19 Commits

Author SHA1 Message Date
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 9352596d39 make: don't interpret the return value of Var_Parse
The return value of Var_Parse is largely redundant to the returned
string.  The idea behind the type VarParseResult was to migrate all call
sites to checking this return value instead of the returned string, but
that hasn't happened.  Instead, the additional type only added more
complexity.

There was a single place where that return value was actually used, when
parsing conditions.  And even in that case, ignoring the VarParseResult
added back an error message that previously hid bugs, in the test
cond-token-plain.mk.

Even though these error messages are redundant in the other tests, they
don't hurt as they don't happen often.
2023-02-14 20:49:09 +00:00
rillig d4d80b7c61 tests/make: reduce trailing whitespace 2022-09-25 12:51:37 +00:00
rillig 78e6536c6f make: make debug logging for comparisons less technical 2022-03-03 19:36:35 +00:00
rillig 577ef4e8d4 make: fix reported line numbers of continuation lines (since 2002)
Previously, multi-line directives like '.info' or '.error' reported the
line number of their last line instead of their first line, which is
more usual.  This also affected the debug log from '-dp'.
2022-01-08 20:21:34 +00:00
rillig 8d39532123 tests/make: demonstrate edge case that evaluates an expression twice 2021-12-30 02:14:55 +00:00
rillig fb0e49c8d2 tests/make: refine comments for parsing and evaluating conditions 2021-12-12 09:36:00 +00:00
rillig 05cd073942 make: do not allow unquoted 'left == right' after modifier ':?'
Having a static variable for state that clearly belongs in the parser
looked suspicious, and indeed it was wrong.

When the distinction between .if conditions and expressions of the form
${condition:?:} was added in cond.c 1.68 from 2015-05-05, a new unit
test was added, but it didn't cover this edge case.  At that time, the
state of the condition parser consisted of a few global variables
instead of a separate data type, as would have been appropriate for
parsing nested conditions.
2021-09-21 22:38:25 +00:00
rillig 0943615cce tests/make: demonstrate unintended unquoted string in conditions 2021-09-21 21:59:56 +00:00
rillig 2a36eea04d make: fix grammar in error message for malformed conditional 2021-06-21 21:10:01 +00:00
rillig 8d4fd1790c make(1): replace warning + error with just an error in conditionals
Before, there was a "warning" for comparing strings using '<', which was
wrong.  That warning was then followed by an error, after parsing the
whole conditional.  This was only because it was easier to implement.

Replace the warning with an actual error.  This only affects
conditionals in .if lines, the conditionals in the :? modifier such as
${"A" < "B":?smaller:greater} still print 2 errors.
2021-01-21 23:32:28 +00:00
rillig 3ba2d0bbf1 make(1): fix debug output for comparison operators in conditionals
This produces fewer warnings than before, but these were edge cases that
probably didn't matter in practice.  The "Malformaed conditional" is
still generated, the set of accepted conditionals is still the same.
2021-01-21 23:25:08 +00:00
rillig 94db50b820 make(1): demonstrate parse error without error message in conditional 2021-01-21 14:08:09 +00:00
rillig 228797e51e make(1): add test case for bare word containing quotes 2021-01-21 13:52:32 +00:00
rillig 0944a3bf8a make(1): add more tests for edge cases in conditionals 2021-01-21 13:32:17 +00:00
rillig 78ff715cb8 make(1): add more tests for tokens in conditionals 2021-01-21 00:38:28 +00:00
rillig 3c08467d34 make(1): add tests for comparison tokens without whitespace 2020-09-12 17:47:24 +00:00
rillig 56350d0e74 make(1): add tests for really strange edge cases in conditions 2020-09-11 06:47:42 +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