aboutsummaryrefslogtreecommitdiffstats
path: root/t/Makefile
blob: 4927ed407c17c2020eb74243a6fd89f75eb48c82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
TESTOBJS=test.o test_common.o test_configuration.o test_curl.o test_packages.o test_transaction.o
CC=gcc
CURLFLAGS=`curl-config --libs`
GPGMEFLAGS=`gpgme-config --libs`
DEFINES=-DSLAPTTESTDIR=$(shell pwd) -DSLAPT_HAS_GPGME
CFLAGS=-W -Werror -Wall -O2 -pedantic $(DEFINES)
LDFLAGS=$(CURLFLAGS) $(GPGMEFLAGS) -lz -lm
CHECKFLAGS=`pkg-config --libs check`

test: $(TESTOBJS)
	$(CC) -o test $(TESTOBJS) $(CFLAGS) ../src/libslapt.so $(CHECKFLAGS) $(LDFLAGS)

runtest: test
	sed -i.bak -re 's|(WORKINGDIR=)([^\/]+.*)|\1$(shell pwd)/\2|' data/rc1
	./test || (mv -f data/rc1.bak data/rc1 || exit 1)
	mv -f data/rc1.bak data/rc1

$(TESTOBJS):

clean:
	-rm *.o test
	-rm -r data/slapt-get