From: Lucas De Marchi Date: Wed, 7 Jan 2015 21:14:20 +0000 (-0200) Subject: testsuite: do not overrid paths inside build X-Git-Tag: v20~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ff7f008cd684ebe524c3ba649a613fe8b9faa65;p=thirdparty%2Fkmod.git testsuite: do not overrid paths inside build If we are accessing a file inside the build directory we should really not trap the path. Right now this isn't important because we never do such accesses. However it will be needed when gcov is integrated because it dumps files to the same place where the binaries are located. --- diff --git a/Makefile.am b/Makefile.am index b9fc8ea9..5df38cb4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -241,6 +241,8 @@ check-am: rootfs check-sysconfdir check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS) testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) +testsuite_path_la_CPPFLAGS = $(AM_CPPFLAGS) \ + -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\" testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) diff --git a/testsuite/path.c b/testsuite/path.c index ba9a5113..fa5fcebd 100644 --- a/testsuite/path.c +++ b/testsuite/path.c @@ -29,6 +29,8 @@ #include #include +#include + #include "testsuite.h" static void *nextlib; @@ -37,7 +39,8 @@ static size_t rootpathlen; static inline bool need_trap(const char *path) { - return path != NULL && path[0] == '/'; + return path != NULL && path[0] == '/' + && !strstartswith(path, ABS_TOP_BUILDDIR); } static const char *trap_path(const char *path, char buf[PATH_MAX * 2])