summaryrefslogtreecommitdiff
path: root/regress
AgeCommit message (Collapse)AuthorFilesLines
2020-05-11mk/subst.mk: fix edge case in detection of identity substitutionsrillig1-4/+24
In a basic regular expression, a dollar-sign only means end-of-string if it appears at the end of the pattern, or (at the choice of the implementation) at the end of a \(...\) subexpression. This affects the package converters/help2man that uses a regular expression containing a dollar in a non-final position. This regular expression had not been detected as an identity substitution even though it is one.
2020-05-11regress/infra-unittests: add tests for identity substitutionsrillig1-1/+9
2020-05-11regress/infra-unittests: run tests in a temporary directoryrillig4-193/+188
This isolates the tests from the test infrastructure and allows the test infrastructure to create arbitrary files for its own purpose without affecting any of the tests.
2020-05-11regress/tools-platform: demonstrate bug in nbsed-20120308rillig1-2/+9
2020-05-09regress/buildlink-transform: clean up coderillig1-6/+3
2020-05-09regress/buildlink-transform: repair most of the regression testrillig1-1/+4
This test is for the old compiler wrapper. Using it with the cwrappers from 2014 makes several test cases fail.
2020-05-09regress/replace-interpreter: fix package installationrillig1-2/+2
2020-05-09regress/make-shell: add missing variable for the shell testrillig1-1/+2
2020-05-09regress/ignore-tools: removerillig3-56/+0
This regression test has been broken for a long time now. It tested the _TOOLS_OPSYS_INCOMPAT variable, which does not exist anymore.
2020-05-09regress/replace-interpreter: ensure order of targetsrillig3-0/+41
2020-05-09regress/infra-unittests: parse command line options [-kv] [-f filter]rillig1-11/+23
2020-05-09regress/infra-unittests: indent here-documentsrillig1-184/+183
2020-05-06mk/subst.mk: allow identity substitutions with escaped dotsrillig1-1/+24
This fixes the build of converters/help2man in SUBST_NOOP_OK=no mode.
2020-05-05regress/infra-unittests: add tests for portability checksrillig1-1/+44
Files like Makefile.am and configure.ac are usually not used during a build, therefore there's no point in checking these for shell portability issues.
2020-05-05mk/check/check-portability: opt-in for newer portability checksrillig1-6/+25
There are a few portability checks that have been existing for years. Later additions need an opt-in phase to avoid breaking existing usages. https://mail-index.netbsd.org/tech-pkg/2020/05/04/msg023084.html
2020-05-04mk/check/check-portability: fix error message when no patches are foundrillig1-1/+19
2020-05-04mk/check/check-portability: skip X.in if X is patchedrillig1-0/+177
A commonly occuring scenario is that a package patches the configure script, but that the corresponding configure.in contains shell code that is not portable. In cases like these, configure.in is typically not used during the build, therefore there is no need to check it for portability. This also applies to all other combinations where a file is patched and the corresponding file.in contains unportable shell code.
2020-05-04regress/check-portability: fix regression test for added line numbersrillig2-19/+4
The line numbers were added to the output in check-portability.awk r1.12.
2020-05-03mk/help: do not treat continuation lines as textual commentsrillig1-1/+28
2020-05-03mk/help: only list help topics that have associated keywordsrillig1-7/+2
2020-05-03regress/infra-unittests: demonstrate wrong help topics without keywordsrillig1-1/+29
2020-05-03regress/tools-platform: document which shell pkgsrc usesrillig1-5/+12
2020-05-02regress/tools: reduce the number of backslashes in the coderillig1-2/+2
2020-05-02regress/tools: adjust COMMENTrillig1-7/+4
2020-05-02regress: move tests for platform tools to tools-platformrillig10-58/+47
2020-05-02regress/infra-unittests: add more tests for subst.mkrillig1-1/+3
Having quotes around the sed commands does not change their meaning. These quotes must not lead to syntax errors when parsing the shell command. This happened in mk/subst.mk r1.91 because the double quote was accidentally escaped.
2020-05-02mk/subst.mk: fix shell parse error for special sed expressionsrillig1-1/+34
The escaping inside the backticks had been wrong. Because of this, parentheses and semicolons were interpreted as shell syntax. Switching to $(...) command substitution removes the need for quoting some of the characters and makes the whole command simpler to understand. Doing the escaping for the backticks command properly would have involved lots of special cases. The $(...) command substitution was used sparingly in pkgsrc up to now because some older or broken shells do not support it. Since these shells do not end up as the shell that runs the commands from Makefiles, that's not a problem.
2020-05-01mk/subst.mk: fix typo in diagnosticrillig1-9/+9
2020-05-01regress/make-shell: reuse the shell tests from the platform testsrillig2-5/+13
2020-05-01regress/make-shell: add another test case for broken Solaris /bin/shrillig1-1/+10
2020-05-01regress/make-shell: regression test for the shell used by devel/bmakerillig2-0/+47
2020-05-01regress: add tools-platform/ for testing the platform toolsrillig3-0/+120
Right now, the tests in regress/tools are a mixture of testing the pkgsrc infrastructure in mk/tools and the tools provided by the platforms. These don't go well together, therefore the tests for the platform tools will be migrated here.
2020-05-01regress/infra-unittests: fix syntax error in test.subrrillig1-1/+3
ShellCheck complained about a parse error in the empty functions, which agrees with the shell grammar given in IEEE 1003.1, both the 2004 Edition and the 2018 Edition.
2020-05-01mk/subst.mk: switch command substitution back to backticksrillig1-1/+24
To work properly, the $(...) should have been $$(...). In pkgsrc the command substitution is usually done via `backticks`, for compatibility with /bin/sh from Solaris. To fix the shell parse errors, the special characters are properly escaped inside the command substitution.
2020-04-29mk/subst.mk: fix combination of SUBST_FILTER_CMD with SUBST_NOOP_OK=norillig1-1/+97
Since SUBST_FILTER_CMD is a shell command, it may contain arbitrary characters. The condition in mk/subst.mk that tested whether SUBST_FILTER_CMD was the default filter command was evaluated at run time. In such an evaluation, the variables (lhs and rhs) are fully expanded before parsing the condition. This means that these variables must not contain quotes or unquoted condition operators. Exactly this situation came up in one of the regression tests. The quoted "0-9" was copied verbatimly into the condition, including the quotes. The resulting condition was: "tr -d "0-9"" == "LC_ALL=C /usr/bin/sed " This produced a syntax error because of the left-hand side. Adding a :Q modifier would have helped for the left-hand side, but this would have been necessary for the right-hand side as well. Since an empty SUBST_SED is defined not to "contain only identity substitutions", the first condition can simply be removed. The whole condition in the shell program had not worked anyway since it expanded to either "[ true ]" or to "[ false ]", and both of these commands exited successfully.
2020-04-29mk/subst.mk: allow identity substitutions in SUBST_NOOP_OK=no moderillig2-3/+201
There are several cases where patterns like s|man|${PKGMANDIR}| appear in SUBST_SED. Up to now, these had been categorized as no-ops and required extra code to make the package build when SUBST_NOOP_OK was set to "no". This was against the original intention of SUBST_NOOP_OK, which was to find outdated substitution patterns that do not occur in SUBST_FILES anymore, most often because the packages have been updated since. The identity substitutions do appear in the files, they just don't change them. Typical cases are for PKGMANDIR, DEVOSSAUDIO, PREFIX, and these variables may well be different in another pkgsrc setup. These patterns are therefore excluded from the SUBST_NOOP_OK check.
2020-04-26regress/make-quoting: demonstrate that the ancient bugs have been fixedrillig5-19/+19
2020-04-26regress/make-quoting: replace obsolete _PKG_SILENT with RUNrillig1-2/+2
2020-04-26regress/infra-unittests: bring files into normal formrillig5-9/+21
2020-04-26regress/infra-unittests: add tests for patch(1)rillig1-0/+82
2020-04-26regress/infra-unittests: add test for subst.mk with unreadable filerillig1-0/+30
2020-04-23mk/subst.mk: warn about all noop patterns before erroring outrillig1-4/+5
2020-04-23mk/subst.mk: omit ./ for sanely named files, quote filename patternsrillig1-24/+24
2020-04-23regress/infra-unittests: ensure that subst.mk preserves the x bitrillig1-1/+34
2020-04-23regress/infra-unittests: add more tests for subst.mkrillig1-0/+94
2020-04-18mk/subst.mk: document that SUBST_VARS does not support dollarrillig1-3/+22
2020-04-18regress/infra-unittests: remove accidental file copyingrillig1-1/+0
2020-04-18mk/subst.mk: make error message for filename pattern easier readablerillig1-8/+4
2020-04-18mk/subst.mk: avoid undefined behavior in regular expressionsrillig1-5/+4
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html says in section 9.3.2 BRE Ordinary Characters that only very few characters may be preceded with a backslash. As a side effect, this change allows parentheses in the variable names listed in SUBST_VARS (even if that will never happen in practice). The reason that the regression test had not replaced VAR.[] before was simply that this variable had not been listed in SUBST_VARS.
2020-03-30regress/infra-unittests: add example tests for mk/help/help.awkrillig1-0/+94
There are many more scenarios that need test cases, but this is a start.