summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests
AgeCommit message (Collapse)Author
2023-07-01tests/make: show how to use indirect conditions in the '?:' modifierrillig
2023-06-28tests/make: extend test for the 'empty' function in conditionsrillig
2023-06-23tests/make: explain and extend tests for expansion in .for loopsrillig
2023-06-23make: warn about malformed patterns in ':M', ':N' and '.if make(...)'rillig
These patterns shouldn't occur in practice, as their results are tricky to predict. Generate a warning for now, and maybe an error later. Reviewed by sjg@.
2023-06-23tests/make: sort missing 'expect' comments by their locationrillig
2023-06-22tests/make: demonstrate inconsistency in pattern matching with rangesrillig
2023-06-22tests/make: fix line numbers in test result, since the previous commitrillig
2023-06-22make: speed up pattern matching in the ':M' and ':N' modifiersrillig
In the code coverage report, the highest count for Str_Match goes from 5,298,924 down to 79,646.
2023-06-22make: clean up comments related to pattern matchingrillig
2023-06-21Cleanup guard testssjg
The .PARSEFILE:tA tests add no value, the correct form is ${.PARSEDIR:tA}/${.PARSEFILE} but even there :tA rarely matters.
2023-06-21make: skip a file protected by a multiple-inclusion guard more oftenrillig
In practice, the common situation is that a file is first included, defines its multiple-inclusion guard and is then skipped instead of being included again. The other way round is that the multiple-inclusion guard is defined when the file is included first. In that case, the file is now regarded as guarded as well.
2023-06-21tests/make: document how wildcards behave in a dependency declarationrillig
2023-06-21tests/make: clean up and extend tests for multiple-inclusion guardsrillig
Multiple-inclusion guards can be defined either as variables or as targets. Rename the variable tests so they include the word 'variable'. Add tests to cover special characters in guard names (both variable and target), just in case ParseVarnameGuard gets removed someday. Document the pitfalls associated with choosing a naming scheme for guards that leads to name clashes, such as with .PARSEFILE without .PARSEDIR.
2023-06-21tests/make: document a few testsrillig
2023-06-21Allow guard targets to use variables.sjg
I commonly use __${.PARSEDIR:tA}__ where a unique guard is needed, __${.PARSEDIR}__ is also useful in many cases. Combination of patch from rillig and mine
2023-06-20make: allow targets to be used as multiple-inclusion guardsrillig
This style is used by FreeBSD, among others.
2023-06-19tests/make: test triple negation in '.ifndef'rillig
2023-06-19make: add tests for full code coverage of multiple-inclusion guardsrillig
2023-06-19Test that .undef of readOnly variable failssjg
2023-06-19make: if a makefile is protected by a guard, only include it oncerillig
"looks reasonable" sjg@
2023-06-18tests/make: clean up test for multiple-inclusion guardsrillig
2023-06-18tests/make: align variable name in test for multiple-inclusion guardsrillig
2023-06-18tests/make: extend test for multiple-inclusion guardsrillig
2023-06-16tests/make: add test for multiple-inclusion guardsrillig
2023-06-16tests/make: clean up tests for the ':M' and ':S' modifiersrillig
2023-06-01tests/make: force line-based diagnostics to be listed in the testsrillig
This way, contradictions between the intended output and the actual output are closer together and have a better chance of being spotted.
2023-06-01make: add more details to debug logging of .for loopsrillig
2023-06-01make: shorten function names, clean up commentsrillig
No functional change.
2023-06-01tests/make: clean up comments, extend a few testsrillig
2023-06-01make: error out on a .break directive with argumentsrillig
2023-05-10tests/make: clean up comments in testsrillig
2023-05-10tests/make: clean up tests for .for loopsrillig
Most of the tests from forloop.mk were already in directive-for.mk.
2023-05-09make: add :mtime to provide mtime of filesjg
The value of the variable is passed to stat(2) and st_mtime is new value. An optional arg can be used if stat(2) fails, otherwise the current time is used. See varmod-mtime.mk for usage examples.
2023-05-09make: skip syntactically wrong .for loopsrillig
When a .for loop cannot be interpreted correctly, for example when there are no iteration variables or the number of words doesn't match the iteration variables, skip the body of the .for loop instead of interpreting it once.
2023-05-09tests/make: clean up tests for ':gmtime' and ':localtime'rillig
2023-05-09make: allow ':gmtime' and ':localtime' with dynamic argumentrillig
This allows ${%Y:L:gmtime=${mtime}} instead of the indirect ${%Y:L:${:Ugmtime=${mtime}}}. The direct form also prevents any ':' from the nested expression to be interpreted as a separator, which doesn't matter for the ':gmtime' and ':localtime' modifiers but will prove useful for other modifiers that follow the same pattern.
2023-05-09tests/make: demonstrate parse bug in :gmtime and :localtime modifiersrillig
2023-05-08make: disallow characters like '$' in variable names in .for loopsrillig
Fixes PR 53146.
2023-05-08tests/make: add more tests for unusual variable names in .for loopsrillig
2023-05-08make: fix parsing of unusual line continuations in .for loopsrillig
2023-04-29tests/make: extend test for target-local variablesrillig
2023-04-28tests/make: add tests for target-local variablesrillig
While here, move a test from var-scope-local.mk to parse.mk since that test is not related to variables.
2023-04-07tests/make: add cross references to command line testsrillig
2023-03-28tests/make: add expectations for string comparison errorsrillig
2023-03-18make: handle .PHONY consitently on interruptsjg
JobDeleteTarget skips .PHONY targets CompatDeleteTarget should do the same This addresses https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269663
2023-03-04tests/make: improve explanations in test for 'empty' functionrillig
2023-03-04tests/make: use proper variable names in short-circuit testrillig
The previous variable names V42, V66, iV1 and iV2 didn't carry enough information to be readily readable, making the test hard to understand. Rename the variables to be more expressive. While here, properly explain what happened behind the scenes in 2020 and how the evaluation of conditions was fixed after discovering the actual cause of the unexpected error messages.
2023-03-04tests/make: test very small and very large numbers in conditionsrillig
2023-02-27tests/make: describe the absent fallback for ':O' modifiers more clearlyrillig
2023-02-26tests/make: extend tests for expression modifiers, especially ':N'rillig