aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJade Lovelace <lix@jade.fyi>2024-10-04 19:13:20 -0700
committerJade Lovelace <lix@jade.fyi>2024-10-04 19:17:08 -0700
commit345e3d068a7f3eb37bb795a38572ae06213a8341 (patch)
tree257cd196eb2e50d9ccfee4ba226ac881bb7f175f /tests
parent19edaed81b44acd11a36fc4759e2e0ae69c7f309 (diff)
testsuite: override NIX_CONF_DIR and NIX_USER_CONF_FILES
The test suite can load the global configuration files under certain circumstances, and, though we would really rather it didn't ever do that at all, we should at least break the mechanism. Fixes: https://git.lix.systems/lix-project/lix/issues/474 Change-Id: Ib27cb43dd5dfaa70ac491c395b5ba308fd7bd289
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/meson.build6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/unit/meson.build b/tests/unit/meson.build
index 8b0c66dd8..04fdf62a7 100644
--- a/tests/unit/meson.build
+++ b/tests/unit/meson.build
@@ -12,7 +12,11 @@
# It's only ~200 lines; better to just refactor the tests themselves which we'll want to do anyway.
default_test_env = {
- 'ASAN_OPTIONS': 'detect_leaks=0:halt_on_error=1:abort_on_error=1:print_summary=1:dump_instruction_bytes=1'
+ 'ASAN_OPTIONS': 'detect_leaks=0:halt_on_error=1:abort_on_error=1:print_summary=1:dump_instruction_bytes=1',
+ # Prevents loading global configuration file in /etc/nix/nix.conf in tests 😱
+ 'NIX_CONF_DIR': '/var/empty',
+ # Prevent loading user configuration files in tests
+ 'NIX_USER_CONF_FILES': '',
}
libutil_test_support_sources = files(