summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/ini/Makefile.am10
-rw-r--r--common/ini/ini_config_ut.c11
2 files changed, 19 insertions, 2 deletions
diff --git a/common/ini/Makefile.am b/common/ini/Makefile.am
index dc30e9471..39ab40b33 100644
--- a/common/ini/Makefile.am
+++ b/common/ini/Makefile.am
@@ -16,7 +16,11 @@ ACLOCAL_AMFLAGS = -I m4
# Set up the pkg-config file
pkgconfigdir = $(libdir)/pkgconfig
-dist_noinst_DATA = ini_config.pc
+dist_noinst_DATA = \
+ ini_config.pc \
+ ini.conf \
+ ini.d/real.conf \
+ ini.d/test.conf
# Build library
noinst_LTLIBRARIES = libini_config.la
@@ -25,6 +29,8 @@ libini_config_la_SOURCES = \
ini_config.h
# Build unit test
-noinst_PROGRAMS = ini_config_ut
+check_PROGRAMS = ini_config_ut
ini_config_ut_SOURCES = ini_config_ut.c
ini_config_ut_LDADD = libini_config.la ../collection/libcollection.la
+
+TESTS = ini_config_ut
diff --git a/common/ini/ini_config_ut.c b/common/ini/ini_config_ut.c
index 7aa59405b..bcb47e6de 100644
--- a/common/ini/ini_config_ut.c
+++ b/common/ini/ini_config_ut.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
+#include <unistd.h>
#define TRACE_HOME
#include "ini_config.h"
#include "collection.h"
@@ -801,6 +802,16 @@ int main(int argc, char *argv[])
{
int error;
+ char *srcdir;
+
+ srcdir = getenv("srcdir");
+ if(srcdir) {
+ if(chdir(srcdir) == 0) {
+ error = errno;
+ return error;
+ }
+ }
+
if ((error = basic_test()) ||
(error = single_file()) ||
(error = real_test(NULL)) ||