Up to [cvs.NetBSD.org] / src / usr.bin / make / unit-tests
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
make: use '"filename" line 123' for locations instead of 'filename:123' The format 'filename:123' is commonly used for identifying a location in a file. Text editors recognize it and allow quick navigation through it. The previous format was specific to make and would have required custom support in editors. The new format was already used in stack traces, except for the first line. Now all lines use the same format.
make: in error message about conditionals, use single quotes Single quotes are used less often in the conditionals themselves, which leads to fewer confusions.
make: on error, print the targets to be made This helps to understand situations with several nested sub-makes in varying directories.
tests/make: test very small and very large numbers in conditions
make: add more details to error message for numeric comparison Before: String comparison operator must be either == or != After: Comparison with '>=' requires both operands 'no' and '10' to be numeric Noticed by martin@ in pkgsrc/textproc/py-pygments.
make: make debug logging for comparisons less technical
tests/make: test spaces around numbers in comparisons Just to see whether it is possible to write a conditional in the form ${ ${A} < ${B} :? ${A} : ${B} }, that is, with leading and trailing whitespace, to make it easier for humans to read the code. It's not possible, the result of this computation cannot be used in further numeric comparisons, at least not in .if directives. Leading space would work, but trailing space wouldn't. On the other hand, they would work in expressions of the form ${ ${A} < ${B} :? ... : ... } since in these, the condition is first expanded and then parsed. But that is an implementation detail that is not documented and it is also difficult to understand.
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.
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.
make(1): add test for wrong comparison operator in conditional
make(1): add test for Infinity and NaN Neither is recognized by the make parser, which is good since the main task of make is dependency resolution and text processing, not calculating.
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.