rp

simple email tools
git clone https://git.parazyd.org/rp
Log | Files | Refs | README | LICENSE

commit f9d3ae8f5ea74ab2f14e0811c8e4307b5dc1e7bf
parent 7bde99cb3c70db456ce8f26fc446f0a8d63917cd
Author: parazyd <parazyd@dyne.org>
Date:   Wed,  2 May 2018 13:55:04 +0200

Rework tests.

Diffstat:
Mtest/Makefile | 23+++++++++++++++--------
Mtest/nettest.c | 3+++
2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/test/Makefile b/test/Makefile @@ -1,17 +1,24 @@ BIN = \ nettest -all: clean alltest -# @echo Possible options are: -# @echo ' * make alltest' -# @echo -# @echo ' * make nettest' +ccflags = -g -std=c99 -Wall -pedantic -I.. -lssl -lcrypto -D_GNU_SOURCE -alltest: $(BIN) +all: clean $(BIN) test + +test: + for i in $(BIN); do \ + echo "================================"; \ + echo " *** Running $$i ***"; \ + echo "================================"; \ + ./$$i; \ + echo "================================"; \ + done nettest: - gcc -g -std=gnu99 -Wall -pedantic -I.. -lssl -lcrypto \ - -o nettest nettest.c ../net.c ../ind.c + cc $(ccflags) -o $@ $@.c ../net.c ../ind.c + +fprtest: + cc $(ccflags) -o $@ $@.c ../net.c ../ind.c clean: rm -f $(BIN) diff --git a/test/nettest.c b/test/nettest.c @@ -20,12 +20,14 @@ int main(void) { net = net_new("tcps!www.facebook.com!https"); if (net == NULL) { perror("net_new"); + printf("FAIL\n"); exit(EXIT_FAILURE); } printf("net_connect\n"); if (net_connect(net)) { perror("net_connect"); + printf("FAIL\n"); exit(EXIT_FAILURE); } @@ -43,5 +45,6 @@ int main(void) { printf("net_free\n"); net_free(net); + printf("SUCCESS\n"); return EXIT_SUCCESS; }