Fix build of unit tests

This commit is contained in:
John Ericson 2024-06-28 14:57:10 -04:00
parent f7ce10dbc1
commit 912c517bc0
5 changed files with 22 additions and 3 deletions

View file

@ -69,6 +69,9 @@ headers = [config_h] + files(
'nix_api_value.h',
)
# TODO don't install this once tests don't use it.
headers += files('nix_api_expr_internal.h')
subdir('build-utils-meson/export-all-symbols')
this_library = library(

View file

@ -61,6 +61,9 @@ headers = [config_h] + files(
'nix_api_store.h',
)
# TODO don't install this once tests don't use it.
headers += files('nix_api_store_internal.h')
subdir('build-utils-meson/export-all-symbols')
this_library = library(

View file

@ -27,6 +27,9 @@ subdir('build-utils-meson/subprojects')
subdir('build-utils-meson/export-all-symbols')
sqlite = dependency('sqlite3', 'sqlite', version : '>=3.6.19')
deps_private += sqlite
rapidcheck = dependency('rapidcheck')
deps_private += rapidcheck

View file

@ -9,6 +9,7 @@
, nix-store
, nix-store-c
, nix-store-test-support
, sqlite
, rapidcheck
, gtest
@ -64,6 +65,7 @@ mkDerivation (finalAttrs: {
nix-store
nix-store-c
nix-store-test-support
sqlite
rapidcheck
gtest
];
@ -94,10 +96,15 @@ mkDerivation (finalAttrs: {
passthru = {
tests = {
run = runCommand "${finalAttrs.pname}-run" {
} ''
run = let
# Inline some drv files shared with the libexpr tests
data = runCommand "${finalAttrs.pname}-test-data" {} ''
cp -r --no-preserve=mode ${./data} $out
cp -r --remove-destination ${../../tests/functional/derivation}/* $out/derivation/
'';
in runCommand "${finalAttrs.pname}-run" {} ''
PATH="${lib.makeBinPath [ finalAttrs.finalPackage ]}:$PATH"
export _NIX_TEST_UNIT_DATA=${./data}
export _NIX_TEST_UNIT_DATA=${data}
nix-store-test
touch $out
'';

View file

@ -57,6 +57,9 @@ headers = [config_h] + files(
'nix_api_util.h',
)
# TODO don't install this once tests don't use it.
headers += files('nix_api_util_internal.h')
subdir('build-utils-meson/export-all-symbols')
this_library = library(