test/Makefile
author Krista Bennett <krista@pep-project.org>
Wed, 31 May 2017 17:47:42 +0200
branchENGINE-209
changeset 1811 04d2a7abcfa2
parent 1682 1a6a30a2b30c
child 1812 925ad845e3ec
permissions -rw-r--r--
ENGINE-209: asserts put into tests. Still have question about PEP_ct_pEp
vb@1513
     1
vb@1513
     2
# This file is under GNU General Public License 3.0
vb@1513
     3
# see LICENSE.txt
vb@1513
     4
vb@2
     5
include ../Makefile.conf
vb@2
     6
krista@1811
     7
export GNUPGHOME=/home/krista/.gnupg/.
krista@1811
     8
#export GNUPGHOME=.
vb@1422
     9
vb@66
    10
CC?=g++ -std=gnu++11 -pthread
vb@66
    11
CXX?=g++ -std=gnu++11 -pthread
vb@66
    12
LD?=$(CXX)
Edouard@134
    13
LDFLAGS?=-L$(HOME)/lib
vb@1304
    14
LDLIBS?=-letpan -lpEpEngine -lstdc++ -L../asn.1 -lasn1
vb@1304
    15
ifeq ($(BUILD_FOR),Linux)
vb@1310
    16
	LDLIBS+= -luuid
vb@1304
    17
endif
roker@762
    18
CXXFLAGS?=-std=c++11 -g -O0 -I../src -I../asn.1
vb@2
    19
# CXXFLAGS=-O3 -DNDEBUG
vb@2
    20
Edouard@178
    21
ifeq ("$(OPENPGP)","NETPGP")
Edouard@178
    22
	LDLIBS+= -lnetpgp
Edouard@178
    23
endif
Edouard@178
    24
vb@2
    25
TARGET=pEpEngineTest
vb@2
    26
vb@50
    27
UNIT_TESTS_SOURCE=$(wildcard *_test.cc)
vb@50
    28
UNIT_TESTS=$(subst .cc,,$(UNIT_TESTS_SOURCE))
krista@1617
    29
UNIT_TESTS_RUN=$(subst .cc,_run,$(UNIT_TESTS_SOURCE))
vb@2
    30
vb@48
    31
all: $(TARGET) $(UNIT_TESTS)
vb@2
    32
vb@2
    33
.PHONY: clean
vb@2
    34
roker@1659
    35
# don't delete .o files!
roker@1659
    36
.PRECIOUS: %.o
roker@1659
    37
vb@2
    38
clean:
vb@458
    39
	rm -f *.o $(TARGET) *.a *~ $(UNIT_TESTS) pep_Dokument_Titel.pdf msg4.asc
vb@1422
    40
	rm -Rf *.dSYM .imported pubring.gpg secring.gpg random_seed *.conf trustdb.gpg
vb@2
    41
vb@1422
    42
.imported:
vb@1422
    43
	-cat 0x*.asc *_sec.asc | gpg2 --import
vb@1422
    44
	touch .imported
vb@1422
    45
vb@1422
    46
test: pEpEngineTest .imported
vb@2
    47
	LD_LIBRARY_PATH=~/lib:../src ./pEpEngineTest
vb@2
    48
roker@1656
    49
%_test : %_test.o test_util.o
roker@1656
    50
	 $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
roker@1656
    51
edouard@1682
    52
%_run : %
Edouard@699
    53
	LD_LIBRARY_PATH=~/lib:../src ./$<
Edouard@699
    54
roker@1656
    55
edouard@1682
    56
%_lldb : %
Edouard@745
    57
	LD_LIBRARY_PATH=~/lib:../src lldb ./$<
Edouard@745
    58
edouard@1682
    59
%_valgrind : %
edouard@1682
    60
	LD_LIBRARY_PATH=~/lib:../src valgrind --leak-check=yes ./$<
edouard@1682
    61
edouard@1682
    62
%_gdb : %
Edouard@770
    63
	LD_LIBRARY_PATH=~/lib:../src gdb ./$<
Edouard@770
    64
Edouard@699
    65
unit_tests: $(UNIT_TESTS) $(UNIT_TESTS_RUN)
vb@142
    66
vb@142
    67
install:
vb@142
    68
	make -C .. install