Use LD_LIBRARY_PATH for running test binary make-cleanup
authorDamiano Boppart <damiano.boppart@pep.security>
Mon, 24 Dec 2018 15:22:55 +0100
branchmake-cleanup
changeset 320648f8fec4b7d1
parent 3205 eb1093486582
child 3207 d2d75fbc0b09
Use LD_LIBRARY_PATH for running test binary
test/Makefile
     1.1 --- a/test/Makefile	Sat Dec 22 01:53:50 2018 +0100
     1.2 +++ b/test/Makefile	Mon Dec 24 15:22:55 2018 +0100
     1.3 @@ -7,8 +7,6 @@
     1.4  
     1.5  include ../Makefile.conf
     1.6  
     1.7 -#VPATH=src
     1.8 -
     1.9  # User's without python3 will skip the generated parts of the test suite. That's OK.
    1.10  PY_ENV:=$(shell command -v python3 2> /dev/null)
    1.11  
    1.12 @@ -62,6 +60,32 @@
    1.13  endif
    1.14  
    1.15  
    1.16 +EXTRA_LIB_PATHS=.:
    1.17 +ifdef ETPAN_LIB
    1.18 +    EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(ETPAN_LIB)):
    1.19 +endif
    1.20 +ifdef GPGME_LIB
    1.21 +    EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(GPGME_LIB)):
    1.22 +endif
    1.23 +ifdef NETPGP_LIB
    1.24 +    EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(NETPGP_LIB)):
    1.25 +endif
    1.26 +ifdef CPPUNIT_LIB
    1.27 +    EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS)$(patsubst -L%,%,$(CPPUNIT_LIB)):
    1.28 +endif
    1.29 +
    1.30 +# Remove trailing ':'
    1.31 +EXTRA_LIB_PATHS:=$(EXTRA_LIB_PATHS::=)
    1.32 +
    1.33 +ifeq ($(BUILD_FOR),Darwin)
    1.34 +    LIBPATH=DYLD_LIBRARY_PATH
    1.35 +else
    1.36 +    LIBPATH=LD_LIBRARY_PATH
    1.37 +endif
    1.38 +
    1.39 +TEST_CMD_PFX=$(LIBPATH)=$(EXTRA_LIB_PATHS)
    1.40 +
    1.41 +
    1.42  .PHONY: all
    1.43  all: suitemaker $(TARGET) scripts
    1.44  
    1.45 @@ -92,7 +116,7 @@
    1.46  
    1.47  .PHONY: test
    1.48  test: all
    1.49 -	$(TEST_DEBUGGER) ./$(TARGET)
    1.50 +	$(TEST_CMD_PFX) $(TEST_DEBUGGER) ./$(TARGET)
    1.51  
    1.52  .PHONY: clean
    1.53  clean: