Commit graph

66 commits

Author SHA1 Message Date
rillig
f2cbf3686f regress/infra-unittests: add more tests for mk/extract/extract
These tests demonstrate that it is not easy to exclude only one top-level
directory from being extracted, using the example of lang/gcc*, which has
a top-level directory contrib/ that contains shell programs with
non-portable code, but the same archive also contains libjava/contrib, and
that should still be extracted.
2020-03-27 21:41:33 +00:00
rillig
83a0097b05 regress/infra-unittests: add test for not extracting certain files 2020-03-25 07:47:10 +00:00
rillig
b885ff75ea mk/subst.mk: ignore directories in SUBST_FILES
Seen in multimedia/libmp4v2, where a pattern also matches the CVS
directory from the distfiles.
2020-03-22 13:19:50 +00:00
rillig
4d12683e99 mk/subst.mk: use the same severity for all messages
The severity now depends only on the setting of SUBST_NOOP_OK. Right now
this means that some former warnings will be reported as info only, but
that will change after switching the default of SUBST_NOOP_OK after
2020Q1. Then they will all be reported as warnings, followed by the final
error saying that the pattern has no effect.

This change makes it easier to detect inconsistencies and outdated
definitions, for example by setting the global SUBST_NOOP_OK=no and
redefining WARNING_MSG to actuall fail.
2020-03-22 12:15:59 +00:00
rillig
e9be1468cd regress: migrate SUBST test to the other SUBST tests
In the old test code, the input and output data for each test case were
in different files. This was too far apart to relate them. In addition,
all test cases were merged into a single big test, which made it hard to
tell the topics apart.
2020-03-21 18:43:02 +00:00
rillig
8e82112864 mk/subst.mk: add global SUBST_SHOW_DIFF variable
This is useful in bulk builds or when trying to understand what happens
under the hood, since the SUBST code leaves no .orig files around.
2020-03-21 13:30:35 +00:00
rillig
f5ff99ee4e regress/infra-unittests: add more tests for subst.mk 2020-03-21 12:47:13 +00:00
rillig
68730ad3f1 mk/subst.mk: fix bmake warnings in case of duplicate SUBST classes 2020-03-21 12:22:31 +00:00
rillig
968d84b496 regress/infra-unittests: fix assertion --file-is-lines
It had compared the actual output with itself, instead of comparing it to
the expected output.
2020-03-21 06:53:18 +00:00
rillig
5fb2a28139 regress/infra-unittests: add tests for special characters in subst.mk 2020-03-20 21:27:04 +00:00
rillig
d1f0656e94 mk/subst.mk: evaluate SUBST_MESSAGE only once, and late
The default value of SUBST_MESSAGE is based on SUBST_FILES, and that
variable may use the :sh modifier to list files from WRKSRC, which may
not exist at load time.
2020-03-20 09:00:44 +00:00
rillig
5f9f5de3b2 regress/infra-unittests: restructure test infrastructure
Before, the first assertion failure quit immediately. This prevented
getting a complete picture of the situation that failed. Now the
assertions continue the test and fail at the very end.
2020-03-20 08:56:42 +00:00
rillig
59545c5e44 mk/subst.mk: fix early evaluation of SUBST_FILES
In the case of pkglocaledir, the SUBST_FILES are generated by a shell
command. That command assumes that the WRKDIR already exists. Therefore
SUBST_FILES must be evaluated as late as possible.

See mk/configure/replace-localedir.mk; an example package that fails is
devel/gettext-tools.
2020-03-20 06:17:48 +00:00
rillig
9f551a7b5a regress/infra-unittests: add more tests for subst.mk failures 2020-03-19 22:46:34 +00:00
rillig
9ca0fcba18 regress/infra-unittests: add tests for mk/subst.mk 2020-03-19 16:58:35 +00:00
rillig
40cf71365f regress/infra-unittests: add small framework for testing mk/ with mocks 2019-03-21 21:45:30 +00:00