diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-11 09:31:24 -0400 |
---|---|---|
committer | Jan Zeleny <jzeleny@redhat.com> | 2012-05-15 09:08:24 +0200 |
commit | 013e9da407a3b583db93f827f054cd2fd6127739 (patch) | |
tree | 389e1a44fc70b3e0a52c72a54c45bcd5986338f3 | |
parent | 6b3bc0158926ed03536c6c72b3847b8c04ace864 (diff) | |
download | ding-libs-013e9da407a3b583db93f827f054cd2fd6127739.tar.gz ding-libs-013e9da407a3b583db93f827f054cd2fd6127739.tar.xz ding-libs-013e9da407a3b583db93f827f054cd2fd6127739.zip |
Fix issue when running make distcheck
When running 'make distcheck', all files in the $srcdir are set to
read-only, to ensure that the build does not modify the source.
However, this broke our ability to test file permissions. We will
now copy the file to the builddir and do the tests there, where
we have control.
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | ini/ini.d/foo.conf.in (renamed from ini/ini.d/foo.conf) | 0 | ||||
-rw-r--r-- | ini/ini_parse_ut.c | 16 |
4 files changed, 8 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am index 4b74b28..167bc1f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -289,6 +289,7 @@ endif clean-local-ini_config: rm -f ./*.out rm -f test.ini + rm -f ./foo.conf #From ini_parse_ut ############################################################################## # Additional rules diff --git a/configure.ac b/configure.ac index 2e22e8a..eae028f 100644 --- a/configure.ac +++ b/configure.ac @@ -77,5 +77,6 @@ AC_CONFIG_FILES([Makefile contrib/ding-libs.spec refarray/ref_array.cfg.doxy refarray/ref_array.pc basicobjects/basicobjects.cfg.doxy basicobjects/basicobjects.pc - ini/ini_config.cfg.doxy ini/ini_config.pc]) + ini/ini_config.cfg.doxy ini/ini_config.pc + ini/ini.d/foo.conf]) AC_OUTPUT diff --git a/ini/ini.d/foo.conf b/ini/ini.d/foo.conf.in index 44d56a1..44d56a1 100644 --- a/ini/ini.d/foo.conf +++ b/ini/ini.d/foo.conf.in diff --git a/ini/ini_parse_ut.c b/ini/ini_parse_ut.c index 75a1145..6cab9d4 100644 --- a/ini/ini_parse_ut.c +++ b/ini/ini_parse_ut.c @@ -42,6 +42,8 @@ char *confdir = NULL; if (verbose) foo; \ } while(0) +#define FOO_CONF "./ini/ini.d/foo.conf" + typedef int (*test_fn)(void); int test_one_file(const char *in_filename, @@ -327,10 +329,8 @@ int merge_values_test(void) const char *resname = "./merge.conf.out"; const char *checkname = "./expect.conf.out"; char command[PATH_MAX * 3]; - char *srcdir; - srcdir = getenv("srcdir"); - sprintf(filename, "%s/ini/ini.d/foo.conf", (srcdir == NULL) ? "." : srcdir); + memcpy(filename, FOO_CONF, sizeof(FOO_CONF)); error = simplebuffer_alloc(&sbobj); if (error) { @@ -639,11 +639,8 @@ int startup_test(void) struct ini_cfgobj *ini_config = NULL; char **error_list = NULL; char filename[PATH_MAX]; - char *srcdir; - srcdir = getenv("srcdir"); - sprintf(filename, "%s/ini/ini.d/foo.conf", - (srcdir == NULL) ? "." : srcdir); + memcpy(filename, FOO_CONF, sizeof(FOO_CONF)); INIOUT(printf("<==== Startup test ====>\n")); @@ -746,15 +743,12 @@ int reload_test(void) char infile[PATH_MAX]; char outfile[PATH_MAX]; const char *command = "cp"; - char *srcdir; char *builddir; int changed = 0; INIOUT(printf("<==== Reload test ====>\n")); - srcdir = getenv("srcdir"); - sprintf(infile, "%s/ini/ini.d/foo.conf", - (srcdir == NULL) ? "." : srcdir); + memcpy(infile, FOO_CONF, sizeof(FOO_CONF)); builddir = getenv("builddir"); sprintf(outfile, "%s/foo.conf", (builddir == NULL) ? "." : builddir); |