mirror of
https://github.com/systemd/systemd
synced 2024-07-22 18:55:10 +00:00
parent
8cb10a4f4d
commit
d9b6baa699
|
@ -17,7 +17,6 @@ in_files = '''
|
||||||
|
|
||||||
support_url = get_option('support-url')
|
support_url = get_option('support-url')
|
||||||
support_sed = 's~%SUPPORT_URL%~@0@~'.format(support_url)
|
support_sed = 's~%SUPPORT_URL%~@0@~'.format(support_url)
|
||||||
build_catalog_dir = meson.current_build_dir()
|
|
||||||
|
|
||||||
foreach file : in_files
|
foreach file : in_files
|
||||||
custom_target(
|
custom_target(
|
||||||
|
|
|
@ -14,14 +14,13 @@
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "macro.h"
|
#include "macro.h"
|
||||||
|
#include "path-util.h"
|
||||||
#include "string-util.h"
|
#include "string-util.h"
|
||||||
|
#include "strv.h"
|
||||||
|
#include "tests.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
static const char *catalog_dirs[] = {
|
static char** catalog_dirs = NULL;
|
||||||
CATALOG_DIR,
|
|
||||||
NULL,
|
|
||||||
};
|
|
||||||
|
|
||||||
static const char *no_catalog_dirs[] = {
|
static const char *no_catalog_dirs[] = {
|
||||||
"/bin/hopefully/with/no/catalog",
|
"/bin/hopefully/with/no/catalog",
|
||||||
NULL
|
NULL
|
||||||
|
@ -167,8 +166,8 @@ static void test_catalog_update(const char *database) {
|
||||||
assert_se(r == 0);
|
assert_se(r == 0);
|
||||||
|
|
||||||
/* Make sure that we at least have some files loaded or the
|
/* Make sure that we at least have some files loaded or the
|
||||||
catalog_list below will fail. */
|
* catalog_list below will fail. */
|
||||||
r = catalog_update(database, NULL, catalog_dirs);
|
r = catalog_update(database, NULL, (const char * const *) catalog_dirs);
|
||||||
assert_se(r == 0);
|
assert_se(r == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,14 +201,26 @@ static void test_catalog_file_lang(void) {
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
_cleanup_(unlink_tempfilep) char database[] = "/tmp/test-catalog.XXXXXX";
|
_cleanup_(unlink_tempfilep) char database[] = "/tmp/test-catalog.XXXXXX";
|
||||||
_cleanup_free_ char *text = NULL;
|
_cleanup_free_ char *text = NULL, *catalog_dir = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
setlocale(LC_ALL, "de_DE.UTF-8");
|
setlocale(LC_ALL, "de_DE.UTF-8");
|
||||||
|
|
||||||
|
log_set_max_level(LOG_DEBUG);
|
||||||
log_parse_environment();
|
log_parse_environment();
|
||||||
log_open();
|
log_open();
|
||||||
|
|
||||||
|
/* 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);
|
||||||
|
|
||||||
|
assert_se(access(catalog_dirs[0], F_OK) >= 0);
|
||||||
|
log_notice("Using catalog directory '%s'", catalog_dirs[0]);
|
||||||
|
|
||||||
test_catalog_file_lang();
|
test_catalog_file_lang();
|
||||||
|
|
||||||
test_catalog_import_invalid();
|
test_catalog_import_invalid();
|
||||||
|
|
|
@ -757,7 +757,7 @@ tests += [
|
||||||
[threads,
|
[threads,
|
||||||
libxz,
|
libxz,
|
||||||
liblz4],
|
liblz4],
|
||||||
'', '', '-DCATALOG_DIR="@0@"'.format(build_catalog_dir)],
|
'', '', '-DCATALOG_DIR="@0@"'.format(catalogdir)],
|
||||||
|
|
||||||
[['src/journal/test-compress.c'],
|
[['src/journal/test-compress.c'],
|
||||||
[libjournal_core,
|
[libjournal_core,
|
||||||
|
|
Loading…
Reference in a new issue