Fix running C test suite when using a separate build directory

Correct top_srcdir path and use ../$(srcdir) instead of just "../" which may
not be the same when building in another directory.
This commit is contained in:
Vadim Zeitlin 2016-04-13 17:01:11 +02:00
commit 3b087fcb2b

View file

@ -7,11 +7,13 @@ C = gcc
CXX = g++
SCRIPTSUFFIX = _runme.c
srcdir = @srcdir@
top_srcdir = @top_srcdir@/..
top_builddir = @top_builddir@/..
top_srcdir = ../@top_srcdir@
top_builddir = ../@top_builddir@
include $(srcdir)/../common.mk
SRCDIR = ../$(srcdir)/
CPP_TEST_CASES += \
cpp_basic_class \
cpp_basic_class_enum \
@ -81,7 +83,7 @@ setup = \
# a file is found which has _runme.c appended after the testcase name.
run_testcase = \
if [ -f $(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) ]; then (\
cd $* && $(COMPILETOOL) $(CC) ../$*_runme.c -L. -l$* -o $*_runme && \
cd $* && $(COMPILETOOL) $(CC) ../$(srcdir)/$(SCRIPTPREFIX)$*$(SCRIPTSUFFIX) -I.. -L. -l$* -o $*_runme && \
env LD_LIBRARY_PATH=".:$$LD_LIBRARY_PATH" PATH=".:$$PATH" SHLIB_PATH=".:$$SHLIB_PATH" DYLD_LIBRARY_PATH=".:$$DYLD_LIBRARY_PATH" $(RUNTOOL) ./$*_runme;) \
fi;