test/Makefile
author Krista Grothoff <krista@pep-project.org>
Thu, 02 Mar 2017 17:54:02 +0100
branchENGINE-174
changeset 1615 858298055d48
parent 1513 e7f7e42385b5
child 1617 4f66da605597
permissions -rw-r--r--
ENGINE-174 / ENGINE-153: Hopefully ratings now do the right thing. HOPEFULLY. Engine tests pass, but we still have this problem for me, anyway, about running unit tests from the make script vs. directly in the directory. elect_pubkey/find_keys somehow doesn't find the key in update_identity, whereas it works locally and from gpg, it works fine. Puzzling, but this has come up before and isn't us directly, I think.
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
vb@1422
     7
export GNUPGHOME=.
vb@1422
     8
vb@66
     9
CC?=g++ -std=gnu++11 -pthread
vb@66
    10
CXX?=g++ -std=gnu++11 -pthread
vb@66
    11
LD?=$(CXX)
Edouard@134
    12
LDFLAGS?=-L$(HOME)/lib
vb@1304
    13
LDLIBS?=-letpan -lpEpEngine -lstdc++ -L../asn.1 -lasn1
vb@1304
    14
ifeq ($(BUILD_FOR),Linux)
vb@1310
    15
	LDLIBS+= -luuid
vb@1304
    16
endif
roker@762
    17
CXXFLAGS?=-std=c++11 -g -O0 -I../src -I../asn.1
vb@2
    18
# CXXFLAGS=-O3 -DNDEBUG
vb@2
    19
Edouard@178
    20
ifeq ("$(OPENPGP)","NETPGP")
Edouard@178
    21
	LDLIBS+= -lnetpgp
Edouard@178
    22
endif
Edouard@178
    23
vb@2
    24
TARGET=pEpEngineTest
vb@2
    25
vb@50
    26
UNIT_TESTS_SOURCE=$(wildcard *_test.cc)
vb@50
    27
UNIT_TESTS=$(subst .cc,,$(UNIT_TESTS_SOURCE))
krista@1615
    28
UNIT_TESTS_RUN=$(subst .cc,_gdb,$(UNIT_TESTS_SOURCE))
vb@2
    29
vb@48
    30
all: $(TARGET) $(UNIT_TESTS)
vb@2
    31
vb@2
    32
.PHONY: clean
vb@2
    33
vb@2
    34
clean:
vb@458
    35
	rm -f *.o $(TARGET) *.a *~ $(UNIT_TESTS) pep_Dokument_Titel.pdf msg4.asc
vb@1422
    36
	rm -Rf *.dSYM .imported pubring.gpg secring.gpg random_seed *.conf trustdb.gpg
vb@2
    37
vb@1422
    38
.imported:
vb@1422
    39
	-cat 0x*.asc *_sec.asc | gpg2 --import
vb@1422
    40
	touch .imported
vb@1422
    41
vb@1422
    42
test: pEpEngineTest .imported
vb@2
    43
	LD_LIBRARY_PATH=~/lib:../src ./pEpEngineTest
vb@2
    44
Edouard@699
    45
%_test_run : %_test
Edouard@699
    46
	LD_LIBRARY_PATH=~/lib:../src ./$<
Edouard@699
    47
Edouard@745
    48
%_test_lldb : %_test
Edouard@745
    49
	LD_LIBRARY_PATH=~/lib:../src lldb ./$<
Edouard@745
    50
Edouard@770
    51
%_test_gdb : %_test
Edouard@770
    52
	LD_LIBRARY_PATH=~/lib:../src gdb ./$<
Edouard@770
    53
Edouard@699
    54
unit_tests: $(UNIT_TESTS) $(UNIT_TESTS_RUN)
vb@142
    55
vb@142
    56
install:
vb@142
    57
	make -C .. install