catalog: open up catalog internals

In order to write tests for the catalog functions, they
are made non-static and start taking a 'database' parameter,
which is the name of a file with the preprocessed catalog
entries.

This makes it possible to make test-catalog part of the
normal test suite, since it now only operates on files
in /tmp.

Some more tests are added.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2013-03-28 23:45:59 -04:00
parent 18cd5fe99f
commit 844ec79b3c
11 changed files with 251 additions and 122 deletions
+4 -4
View File
@@ -138,7 +138,7 @@ AM_CPPFLAGS = \
-DUSER_CONFIG_FILE=\"$(pkgsysconfdir)/user.conf\" \
-DUSER_CONFIG_UNIT_PATH=\"$(pkgsysconfdir)/user\" \
-DUSER_DATA_UNIT_PATH=\"$(userunitdir)\" \
-DCATALOG_PATH=\"$(catalogstatedir)\" \
-DCATALOG_DATABASE=\"$(catalogstatedir)/database\" \
-DSYSTEMD_CGROUP_AGENT_PATH=\"$(rootlibexecdir)/systemd-cgroups-agent\" \
-DSYSTEMD_BINARY_PATH=\"$(rootlibexecdir)/systemd\" \
-DSYSTEMD_SHUTDOWN_BINARY_PATH=\"$(rootlibexecdir)/systemd-shutdown\" \
@@ -2748,8 +2748,7 @@ UNINSTALL_DATA_HOOKS += \
catalog-remove-hook
noinst_PROGRAMS += \
test-journal-enum \
test-catalog
test-journal-enum
noinst_tests += \
test-journal \
@@ -2758,7 +2757,8 @@ noinst_tests += \
test-journal-match \
test-journal-stream \
test-journal-verify \
test-mmap-cache
test-mmap-cache \
test-catalog
pkginclude_HEADERS += \
src/systemd/sd-journal.h \