conf.set_quoted('SYSTEMD_KBD_MODEL_MAP', join_paths(pkgdatadir, 'kbd-model-map'))
conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP', join_paths(pkgdatadir, 'language-fallback-map'))
conf.set_quoted('SYSTEMD_TEST_DATA', join_paths(testsdir, 'testdata'))
+conf.set_quoted('SYSTEMD_CATALOG_DIR', catalogdir)
conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
conf.set_quoted('LIBDIR', libdir)
conf.set('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default ? 'true' : 'false')
conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no')
-conf.set_quoted('ABS_BUILD_DIR', meson.build_root())
-
substs.set('prefix', prefixdir)
substs.set('exec_prefix', prefixdir)
substs.set('libdir', libdir)
output : 'systemd-runtest.env',
command : ['sh', '-c', '{ ' +
'echo SYSTEMD_TEST_DATA=@0@; '.format(join_paths(meson.current_source_dir(), 'test')) +
+ 'echo SYSTEMD_CATALOG_DIR=@0@; '.format(join_paths(meson.current_build_dir(), 'catalog')) +
'} >@OUTPUT@'],
build_by_default : true)
/* If test-catalog is located at the build directory, then use catalogs in that.
* If it is not, e.g. installed by systemd-tests package, then use installed catalogs. */
- if (test_is_running_from_builddir(NULL)) {
- assert_se(catalog_dir = path_join(NULL, ABS_BUILD_DIR, "catalog"));
- catalog_dirs = STRV_MAKE(catalog_dir);
- } else
- catalog_dirs = STRV_MAKE(CATALOG_DIR);
+ catalog_dirs = STRV_MAKE(get_catalog_dir());
assert_se(access(catalog_dirs[0], F_OK) >= 0);
log_notice("Using catalog directory '%s'", catalog_dirs[0]);
setenv(*k, *v, 0);
}
-bool test_is_running_from_builddir(char **exedir) {
- load_testdata_env();
-
- return !!getenv("SYSTEMD_TEST_DATA");
-}
-
const char* get_testdata_dir(void) {
const char *env;
return env;
}
+
+const char* get_catalog_dir(void) {
+ const char *env;
+
+ load_testdata_env();
+
+ /* if the env var is set, use that */
+ env = getenv("SYSTEMD_CATALOG_DIR");
+ if (!env)
+ env = SYSTEMD_CATALOG_DIR;
+ if (access(env, F_OK) < 0) {
+ fprintf(stderr, "ERROR: $SYSTEMD_CATALOG_DIR directory [%s] does not exist\n", env);
+ exit(EXIT_FAILURE);
+ }
+ return env;
+}
#pragma once
char* setup_fake_runtime_dir(void);
-bool test_is_running_from_builddir(char **exedir);
const char* get_testdata_dir(void);
+const char* get_catalog_dir(void);
libshared],
[threads,
libxz,
- liblz4],
- '', '', '-DCATALOG_DIR="@0@"'.format(catalogdir)],
+ liblz4]],
[['src/journal/test-compress.c'],
[libjournal_core,