diff options
Diffstat (limited to 'tests/unit/meson.build')
-rw-r--r-- | tests/unit/meson.build | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 8ff0b5ec5..9db619c5d 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( @@ -39,6 +43,8 @@ liblixutil_test_support = declare_dependency( ) libutil_tests_sources = files( + 'libutil/async-collect.cc', + 'libutil/async-semaphore.cc', 'libutil/canon-path.cc', 'libutil/checked-arithmetic.cc', 'libutil/chunked-vector.cc', @@ -76,6 +82,7 @@ libutil_tester = executable( liblixexpr_mstatic, liblixutil_test_support, nlohmann_json, + kj, ], cpp_pch : cpp_pch, ) @@ -252,7 +259,7 @@ test( env : default_test_env + { # No special meaning here, it's just a file laying around that is unlikely to go anywhere # any time soon. - '_NIX_TEST_UNIT_DATA': meson.project_source_root() / 'src/nix-env/buildenv.nix', + '_NIX_TEST_UNIT_DATA': meson.project_source_root() / 'src/legacy/buildenv.nix', # Use a temporary home directory for the unit tests. # Otherwise, /homeless-shelter is created in the single-user sandbox, and functional tests will fail. # TODO(alois31): handle TMPDIR properly (meson can't, and setting HOME in the test is too late)… @@ -262,9 +269,14 @@ test( protocol : 'gtest', ) +libmain_tests_sources = files( + 'libmain/crash.cc', + 'libmain/progress-bar.cc', +) + libmain_tester = executable( 'liblixmain-tests', - files('libmain/progress-bar.cc'), + libmain_tests_sources, dependencies : [ liblixmain, liblixexpr, |