test/Makefile
author Volker Birk <vb@pep.foundation>
Wed, 23 Nov 2016 13:19:27 +0100
changeset 1422 860391e5e5b9
parent 1310 f4089c6c5649
child 1513 e7f7e42385b5
permissions -rw-r--r--
testing
vb@2
     1
include ../Makefile.conf
vb@2
     2
vb@1422
     3
export GNUPGHOME=.
vb@1422
     4
vb@66
     5
CC?=g++ -std=gnu++11 -pthread
vb@66
     6
CXX?=g++ -std=gnu++11 -pthread
vb@66
     7
LD?=$(CXX)
Edouard@134
     8
LDFLAGS?=-L$(HOME)/lib
vb@1304
     9
LDLIBS?=-letpan -lpEpEngine -lstdc++ -L../asn.1 -lasn1
vb@1304
    10
ifeq ($(BUILD_FOR),Linux)
vb@1310
    11
	LDLIBS+= -luuid
vb@1304
    12
endif
roker@762
    13
CXXFLAGS?=-std=c++11 -g -O0 -I../src -I../asn.1
vb@2
    14
# CXXFLAGS=-O3 -DNDEBUG
vb@2
    15
Edouard@178
    16
ifeq ("$(OPENPGP)","NETPGP")
Edouard@178
    17
	LDLIBS+= -lnetpgp
Edouard@178
    18
endif
Edouard@178
    19
vb@2
    20
TARGET=pEpEngineTest
vb@2
    21
vb@50
    22
UNIT_TESTS_SOURCE=$(wildcard *_test.cc)
vb@50
    23
UNIT_TESTS=$(subst .cc,,$(UNIT_TESTS_SOURCE))
Edouard@699
    24
UNIT_TESTS_RUN=$(subst .cc,_run,$(UNIT_TESTS_SOURCE))
vb@2
    25
vb@48
    26
all: $(TARGET) $(UNIT_TESTS)
vb@2
    27
vb@2
    28
.PHONY: clean
vb@2
    29
vb@2
    30
clean:
vb@458
    31
	rm -f *.o $(TARGET) *.a *~ $(UNIT_TESTS) pep_Dokument_Titel.pdf msg4.asc
vb@1422
    32
	rm -Rf *.dSYM .imported pubring.gpg secring.gpg random_seed *.conf trustdb.gpg
vb@2
    33
vb@1422
    34
.imported:
vb@1422
    35
	-cat 0x*.asc *_sec.asc | gpg2 --import
vb@1422
    36
	touch .imported
vb@1422
    37
vb@1422
    38
test: pEpEngineTest .imported
vb@2
    39
	LD_LIBRARY_PATH=~/lib:../src ./pEpEngineTest
vb@2
    40
Edouard@699
    41
%_test_run : %_test
Edouard@699
    42
	LD_LIBRARY_PATH=~/lib:../src ./$<
Edouard@699
    43
Edouard@745
    44
%_test_lldb : %_test
Edouard@745
    45
	LD_LIBRARY_PATH=~/lib:../src lldb ./$<
Edouard@745
    46
Edouard@770
    47
%_test_gdb : %_test
Edouard@770
    48
	LD_LIBRARY_PATH=~/lib:../src gdb ./$<
Edouard@770
    49
Edouard@699
    50
unit_tests: $(UNIT_TESTS) $(UNIT_TESTS_RUN)
vb@142
    51
vb@142
    52
install:
vb@142
    53
	make -C .. install