nix-super/mk
Valentin Gagarin 33ca905cdb tests: simplify initialisation and wiring
pararameterisation is not actually needed the way things are currently
set up, and it confused me when trying to understand what the code does.

all but one test sources vars-and-functions.sh, which nominally only
defines variables, but in practice is always coupled with the actual
initialisation. while the cleaner way of making this more legible would
be to source variables and initialisation separately, this would produce
a huge diff.

the change requires a few small fixes to keep the tests working:

- only create test home directory during initialisation

  that vars-and-functions.sh wrote to the file system seems not write

- fix creation of the test directory

  due to statefulness, the test home directory was implicitly creating
  the test root, too. decoupling that made it apparent that this was
  probably not intentional, and certainly confusing.

- only source vars-and-functions.sh if init.sh is not needed

  there is one test case that only needs a helper function but no
  initialisation side effects

- remove some unnecessary cleanups and split parts of re-used test code

  there were confusing bits in how initialisation code was repurposed,
  which break if trying to refactor the outer layers naively...
2024-05-13 15:19:49 +02:00
..
build-dir.mk Use buildprefix in a few more places 2023-11-29 19:49:07 -05:00
clean.mk Add 'mk/' from commit '1eff3ad37fdb9dcf9f8528fdacea0ebf0e79d545' 2014-02-01 14:38:28 +01:00
common-test.sh tests: remove unneeded indirection 2024-05-06 15:57:22 +02:00
compilation-database.mk Create compile-commands.json with Make 2024-03-21 15:55:44 +08:00
cxx-big-literal.mk Replace foo with __NIX_STR in cxx-big-literal 2024-03-09 17:05:56 -08:00
debug-test.sh tests: simplify initialisation and wiring 2024-05-13 15:19:49 +02:00
functions.mk Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
install-dirs.mk Use buildprefix in a few more places 2023-11-29 19:49:07 -05:00
install.mk Sync with make-rules repo 2014-04-03 17:37:14 +02:00
lib.mk tests: simplify initialisation and wiring 2024-05-13 15:19:49 +02:00
libraries.mk makefiles: Do some HOST_CYGWIN -> HOST_WINDOWS 2024-01-11 23:28:11 -05:00
patterns.mk Create compile-commands.json with Make 2024-03-21 15:55:44 +08:00
platform.mk Build Windows DLLs with -Wl,--export-all-symbols 2024-01-11 23:34:37 -05:00
precompiled-headers.mk mk/precompiled-headers.mk: Remove special handling for clang 2020-10-06 13:27:09 +02:00
programs.mk makefiles: Support .exe executable prefix on Windows 2024-01-11 23:28:11 -05:00
run-test.sh tests: simplify initialisation and wiring 2024-05-13 15:19:49 +02:00
templates.mk *.in files: Depend on config.status 2024-02-13 16:10:56 +01:00
tests.mk tests: simplify initialisation and wiring 2024-05-13 15:19:49 +02:00
tracing.mk Create compile-commands.json with Make 2024-03-21 15:55:44 +08:00