Commit Graph

20 Commits

Author SHA1 Message Date
sjg 68f52b2486 t_make skip varname-dot-make-meta-ignore_*
The meta-ignore tests will likely not work in this environment
so skip them.
2023-02-25 19:37:33 +00:00
rillig d67dd6957e tests/make: rename files that are not test cases 2023-01-19 23:26:14 +00:00
rillig 3737a339ac tests/make: remove ATF descr
The description of the tests is not going to be added anytime soon, as
that would either create redundancy or additional run-time cost.
Parsing and evaluating unit-tests/Makefile is already O(n^2) with regard
to the number of tests, and there are quite a few tests.  Therefore don't
add any overhead for now.
2021-04-17 11:36:34 +00:00
rillig 11173f1b80 tests/make: indent consistently 2021-04-17 11:31:25 +00:00
rillig eefa5d1cf5 tests/make: simplify selection of the files to be copied
No functional change.
2021-04-17 11:21:17 +00:00
martin a9fe9302e9 Run all make tests as unprileged user - makes checking permission issues
a lot easier.
2021-02-06 19:00:25 +00:00
rillig 3e905e9da4 make(1): split test suffixes.mk into simpler, isolated tests
The code in suff.c is already hard to understand, and so were the tests
in suffixes.mk since several independent topics were merged into a
single test.

Splitting this test into a separate test per issue allows to document
the expected and actual behavior in more detail.  That's complicated
enough already.

PR bin/49086
2020-10-20 20:36:53 +00:00
kre f1b3a283f6 Whitespace. NFC. 2020-09-10 17:40:34 +00:00
kre b1ea2bb886 Replace use of tr to translate '-' in test names into '_' to satisfy ATF
requirements (correct sh variable/function name syntax).  Use a sh
loop instead, and save one fork() one vfork() and one exec of tr for
each test case (many of which don't need anything done to them at all).

This might partially mitigate PR misc/55595
2020-09-10 17:33:16 +00:00
rillig edce479061 make(1): mark tests impsrc and phony-end as no longer failing
These tests have been adjusted to demonstrate the current behavior,
mentioning the expected behavior in comments.
2020-08-15 01:50:54 +00:00
rillig c32d14bd2e usr.bin/make: fix test failure
The two files include-sub.mk and include-subsub.mk were never intended to
be test cases on their own.  They belong to include-main.mk.

Fixes PR bin/55360.
2020-06-08 19:50:10 +00:00
martin 5f67668838 Mark the failing tests as expected failure and point to PR toolchain/49085. 2015-01-27 12:57:14 +00:00
apb 8a8b2bfa2a Remove commented-out debug code that was accidentally committed yesterday. 2014-08-23 16:26:13 +00:00
christos 39d8f8959e not needed anymore. 2014-08-23 16:02:54 +00:00
christos be0d87e66b undo previous bogus merge of PR49085 2014-08-23 15:10:18 +00:00
christos defa6c58f6 PR/46096: Jarmo Jaakkola: fix many problems with dependencies (PR 49086)
Quite extensive rewrite of the Suff module.  Some ripple effects into
Parse and Targ modules too.

Dependency searches in general were made to honor explicit rules so
implicit and explicit sources are no longer applied on targets that
do not invoke a transformation rule.

Archive member dependency search was rewritten.  Explicit rules now
work properly and $(.TARGET) is set correctly.  POSIX semantics for
lib(member.o) and .s1.a rules are supported.

.SUFFIXES list maintenance was rewritten so that scanning of existing
rules works when suffixes are added and that clearing the suffix list
removes single suffix rules too.  Transformation rule nodes are now
mixed with regular nodes so they are available as regular targets too
if needed (especially after the known suffixes are cleared).

The .NULL target was documented in the manual page, especially to
warn against using it when a single suffix rule would work.
A deprecation warning was also added to the manual and make also
warns the user if it encounters .NULL.

Search for suffix rules no longer allows the explicit dependencies
to override the selected transformation rule.  A check is made in
the search that the transformation that would be tried does not
already exist in the chain.  This prevents getting stuck in an infinite
loop under specific circumstances.  Local variables are now set
before node's children are expanded so dynamic sources work in
multi-stage transformations.  Make_HandleUse() no longer expands
the added children for transformation nodes, preventing triple
expansion and allowing the Suff module to properly postpone their
expansion until proper values are set for the local variables.

Directory prefix is no longer removed from $(.PREFIX) if the target
is found via directory search.

The last rule defined is now used instead of the first one (POSIX
requirement) in case a rule is defined multiple times.  Everything
defined in the first instance is undone, but things added "globally"
are honored.  To implement this, each node tracks attribute bits
which have been set by special targets (global) instead of special
sources (local).  They also track dependencies that were added by
a rule with commands (local) instead of rule with no commands (global).

New attribute, OP_FROM_SYS_MK is introduced.  It is set on all targets
found in system makefiles so that they are not eligible to become
the main target.  We cannot just set OP_NOTMAIN because it is one of
the attributes inherited from transformation and .USE rules and would
make any eligible target that uses a built-in inference rule ineligible.

The $(.IMPSRC) local variable now works like in gmake: it is set to
the first prerequisite for explicit rules.  For implicit rules it
is still the implied source.

The manual page is improved regarding the fixed features.  Test cases
for the fixed problems are added.

Other improvements in the Suff module include:
  - better debug messages for transformation rule search (length of
    the chain is now visualized by indentation)
  - Suff structures are created, destroyed and moved around by a set
    of maintenance functions so their reference counts are easier
    to track (this also gets rid of a lot of code duplication)
  - some unreasonably long functions were split into smaller ones
  - many local variables had their names changed to describe their
    purpose instead of their type
2014-08-23 15:05:40 +00:00
christos 4da7383dde PR/49085: Jarmo Jaakkola: fix several parsing errors
Don't exit from var.c:Var_Parse() before possible modifiers are handled
on D and F modified versions of local variables.  Properly expand $(?D)
and $(?F) too.

Make line continuations in rule's commands POSIX compliant.

Fix the syntax error caused by lib(member) as the last target before
a dependency operator.

Document the line continuation change in the manual page.  Also talk
more about the POSIX style local variables and their modifiers.

Add tests covering the fixed problems into d_posix.mk.  The test is
a known failure at the moment because of PR 49086 and PR 49092.

[XXX: unconverted tests]
2014-08-23 14:50:24 +00:00
apb 6b933a652f Test make(1) by running the maintained tests, not unmaintained
copies of them.

* Remove all old tests from src/tests/usr.bin/make/d_*.  These tests
  were unmaintained old copies of the actual tests which are maintained
  under src/usr.bin/make/unit-tests.  One exception is the test in
  d_unmatchedvarparen.mk, which was new, but has nw been added to
  src/usr.bin/make/unit-tests/varmisc.mk.
* In src/tests/usr.bin/make/Makefile, copy all
  the tests from src/usr.bin/make/unit-tests to
  ${DESTDIR}/usr/tests/usr.bin/make/unit-tests.
* In src/tests/usr.bin/make/t_make.sh, run the tests installed above,
  instead of the old tests.
* In etc/mtree/NetBSD.dist.tests, create the
  usr/tests/usr.bin/make/unit-tests diectory.
* Update the set lists for all the above.
2014-08-22 16:45:32 +00:00
christos fa3151c9b2 adjust for make(1) printing the nesting level. 2013-07-24 14:03:22 +00:00
jruoho 28604916d4 Deprecate tests/util. 2012-03-17 16:33:10 +00:00