Skip to content

Commit 218c63c

Browse files
committed
Remove installed test for simplicity and easier development. Add environment variables from lib Makefile to test same with same env.
1 parent 428687f commit 218c63c

1 file changed

Lines changed: 13 additions & 33 deletions

File tree

tests/Makefile

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,37 @@ CC = g++
44
CPPFLAGS = -g -std=c++98 -DGTEST_HAS_PTHREAD=0
55
DEFS = -DFIPS
66

7-
############# COMP ENVIRONMENT VARIABLES #############
8-
ifndef LIBCRYPTOSEC
9-
LIBCRYPTOSEC = ../libcryptosec.so
10-
endif
7+
############# ENVIRONMENT ###############################
8+
OPENSSL_PREFIX ?= /usr
9+
OPENSSL_LIBDIR ?= $(OPENSSL_PREFIX)/lib64
10+
OPENSSL_INCLUDEDIR ?= $(OPENSSL_PREFIX)/include
11+
LIBCRYPTOSEC ?= ../libcryptosec.so
12+
GTEST_INCLUDEDIR ?= /usr/include/gtest
13+
SRC_DIR ?= src/unit
1114

12-
ifndef SSL_DIR
13-
SSL_DIR=/usr/local/ssl/include/
14-
endif
1515

16-
ifndef GTEST_INCLUDE
17-
GTEST_DIR=/usr/include/gtest
18-
endif
19-
20-
ifndef SRC_DIR
21-
SRC_DIR = src/unit
22-
endif
16+
############ DEPENDENCIES ############################
17+
#LIBS = $(LIBCRYPTOSEC) -lgtest -lcrypto -lssl -pthread
18+
#INCLUDES = -I../include -I$(GTEST_DIR) -I$(SSL_DIR)
2319

24-
ARQ= $(shell uname -m)
25-
LIBDIR = /usr/lib
26-
ifeq ($(ARQ), x86_64)
27-
LIBDIR=/usr/lib64
28-
endif
2920

30-
############ DEPENDENCIES ############################
31-
LIBS = $(LIBCRYPTOSEC) -lgtest -lcrypto -lssl -pthread
32-
INCLUDES = -I../include -I$(GTEST_DIR) -I$(SSL_DIR)
21+
LIBS = $(LIBCRYPTOSEC) -L$(OPENSSL_LIBDIR) -Wl,-rpath,$(OPENSSL_LIBDIR) -lcrypto -lgtest -pthread
22+
INCLUDES = -I$(OPENSSL_INCLUDEDIR) -I$(GTEST_INCLUDEDIR) -I../include
3323

3424
########### OBJECTS ##################################
3525
TEST_SRCS += $(wildcard $(SRC_DIR)/*.cpp)
3626
OBJS += $(TEST_SRCS:.cpp=.o)
3727

3828
########### AUX TARGETS ##############################
3929
.set_static:
40-
$(eval LIBS= $(LIBCRYPTOSEC) -lgtest)
41-
42-
.set_installed:
43-
$(eval INCLUDES=-I/usr/include/libcryptosec -I$(GTEST_DIR) -I$(SSL_DIR))
30+
$(eval LIBS= $(LIBCRYPTOSEC) -lgtest -pthread)
4431

4532
.set_engine:
4633
$(eval DEFS+= -DENGINE_COMP)
4734

4835
.check_compiled:
4936
@test -s $(LIBCRYPTOSEC) || { echo "You should COMPILE libcryptosec first!"; exit 1; }
5037

51-
.check_installed:
52-
@test -s $(LIBDIR)/libcryptosec.so || { echo "You should INSTALL libcryptosec first!"; exit 1; }
53-
5438
%.o: %.cpp
5539
$(CC) $(CPPFLAGS) $(DEFS) $(INCLUDES) -O0 -Wall -c -o "$@" "$<"
5640

@@ -78,10 +62,6 @@ test_engine_dynamic: .check_compiled .set_engine .comp .run_engine
7862

7963
test_engine_static: .check_compiled .set_engine .set_static .comp .run_engine
8064

81-
installed_test_dynamic: .check_installed .set_installed .comp .run
82-
83-
installed_test_static: .check_installed .set_static .set_installed .comp .run
84-
8565
clean:
8666
rm -rf ./$(SRC_DIR)/*.o $(NAME)
8767

0 commit comments

Comments
 (0)