Skip to content

Commit ad859f3

Browse files
committed
test/unit/Makefile: run the test in build dir
In case that eg. LD_LIBRARY_PATH is set by direnv, it is better to run in build dir as a working directory. + append the passed $(LIBDIR) to $LD_LIBRARY_PATH rather than replacing
1 parent 1ae7155 commit ad859f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/unit/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ BUILD_DIR ?= .
22
LIBDIR ?= ../../build
33

44
all: run_tests
5-
LD_LIBRARY_PATH=$(LIBDIR) $(BUILD_DIR)/$<
5+
cd $(BUILD_DIR);\
6+
LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}$(LIBDIR) ./$<
67

78
run_tests: $(wildcard *.c)
89
$(CC) -g -I../.. $^ -L$(LIBDIR) -lgpujpeg -lcudart -o $(BUILD_DIR)/$@

0 commit comments

Comments
 (0)