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
     1 
     2 # This file is under GNU General Public License 3.0
     3 # see LICENSE.txt
     4 
     5 include ../Makefile.conf
     6 
     7 export GNUPGHOME=/home/krista/.gnupg/.
     8 #export GNUPGHOME=.
     9 
    10 CC?=g++ -std=gnu++11 -pthread
    11 CXX?=g++ -std=gnu++11 -pthread
    12 LD?=$(CXX)
    13 LDFLAGS?=-L$(HOME)/lib
    14 LDLIBS?=-letpan -lpEpEngine -lstdc++ -L../asn.1 -lasn1
    15 ifeq ($(BUILD_FOR),Linux)
    16 	LDLIBS+= -luuid
    17 endif
    18 CXXFLAGS?=-std=c++11 -g -O0 -I../src -I../asn.1
    19 # CXXFLAGS=-O3 -DNDEBUG
    20 
    21 ifeq ("$(OPENPGP)","NETPGP")
    22 	LDLIBS+= -lnetpgp
    23 endif
    24 
    25 TARGET=pEpEngineTest
    26 
    27 UNIT_TESTS_SOURCE=$(wildcard *_test.cc)
    28 UNIT_TESTS=$(subst .cc,,$(UNIT_TESTS_SOURCE))
    29 UNIT_TESTS_RUN=$(subst .cc,_run,$(UNIT_TESTS_SOURCE))
    30 
    31 all: $(TARGET) $(UNIT_TESTS)
    32 
    33 .PHONY: clean
    34 
    35 # don't delete .o files!
    36 .PRECIOUS: %.o
    37 
    38 clean:
    39 	rm -f *.o $(TARGET) *.a *~ $(UNIT_TESTS) pep_Dokument_Titel.pdf msg4.asc
    40 	rm -Rf *.dSYM .imported pubring.gpg secring.gpg random_seed *.conf trustdb.gpg
    41 
    42 .imported:
    43 	-cat 0x*.asc *_sec.asc | gpg2 --import
    44 	touch .imported
    45 
    46 test: pEpEngineTest .imported
    47 	LD_LIBRARY_PATH=~/lib:../src ./pEpEngineTest
    48 
    49 %_test : %_test.o test_util.o
    50 	 $(LD) $(LDFLAGS) -o $@ $^ $(LDLIBS)
    51 
    52 %_run : %
    53 	LD_LIBRARY_PATH=~/lib:../src ./$<
    54 
    55 
    56 %_lldb : %
    57 	LD_LIBRARY_PATH=~/lib:../src lldb ./$<
    58 
    59 %_valgrind : %
    60 	LD_LIBRARY_PATH=~/lib:../src valgrind --leak-check=yes ./$<
    61 
    62 %_gdb : %
    63 	LD_LIBRARY_PATH=~/lib:../src gdb ./$<
    64 
    65 unit_tests: $(UNIT_TESTS) $(UNIT_TESTS_RUN)
    66 
    67 install:
    68 	make -C .. install