mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
Make functional tests depend on nix binary so they auto recompile
With this I'm able to do a fresh config + meson test with all dependencies correctly propagated. Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
This commit is contained in:
parent
241420a788
commit
bf320465ae
5 changed files with 21 additions and 6 deletions
|
|
@ -223,6 +223,18 @@ subdir('local-overlay-store')
|
|||
foreach suite : suites
|
||||
workdir = suite['workdir']
|
||||
suite_name = suite['name']
|
||||
# This is workaround until [1] is resolved. When building in a devshell
|
||||
# as a subproject we want the tests to depend on the nix build target, so
|
||||
# that it gets automatically rebuilt.
|
||||
# However, when the functional test suite is built separately (via componentized
|
||||
# builds or in NixOS tests) we can't depend on the nix executable, since it's
|
||||
# an external program. The following is a simple heuristic that suffices for now.
|
||||
# [1]: https://github.com/mesonbuild/meson/issues/13877
|
||||
deps = suite['deps']
|
||||
if meson.is_subproject()
|
||||
nix_subproject = subproject('nix')
|
||||
deps += [ nix ] + nix_subproject.get_variable('nix_symlinks_targets')
|
||||
endif
|
||||
foreach script : suite['tests']
|
||||
# Turns, e.g., `tests/functional/flakes/show.sh` into a Meson test target called
|
||||
# `functional-flakes-show`.
|
||||
|
|
@ -252,7 +264,7 @@ foreach suite : suites
|
|||
# them more time than the default of 30 seconds.
|
||||
timeout : 300,
|
||||
# Used for target dependency/ordering tracking, not adding compiler flags or anything.
|
||||
depends : suite['deps'],
|
||||
depends : deps,
|
||||
workdir : workdir,
|
||||
)
|
||||
endforeach
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue