From c98c0d913e3720e61f42d1fabc56a12a73a612ae Mon Sep 17 00:00:00 2001 From: Jose Bollo Date: Fri, 6 Jul 2018 17:07:19 +0200 Subject: [PATCH] coverage: Improve testing MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Add test of bindings v2 - Distinguish between clean and cleanall - More valgrind ouput Change-Id: If929756d9d35ddb959b46f7330cbf318301d532e Signed-off-by: José Bollo --- coverage/.gitignore | 3 +++ coverage/Makefile | 6 +++-- coverage/bin/Makefile | 7 +++++- coverage/scripts/02-hello.sh | 2 ++ coverage/scripts/05-hello-v2.sh | 52 +++++++++++++++++++++++++++++++++++++++++ coverage/scripts/run-test.sh | 1 + 6 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 coverage/.gitignore create mode 100755 coverage/scripts/05-hello-v2.sh diff --git a/coverage/.gitignore b/coverage/.gitignore new file mode 100644 index 00000000..43d04cb6 --- /dev/null +++ b/coverage/.gitignore @@ -0,0 +1,3 @@ +lcov-out.info +report/ +valgrind.out diff --git a/coverage/Makefile b/coverage/Makefile index 219321c7..3f5f3ce3 100644 --- a/coverage/Makefile +++ b/coverage/Makefile @@ -8,11 +8,13 @@ all: report binaries: make -C bin -w binaries -.PHONY: clean +.PHONY: clean cleanall clean: make -C bin -w clean - rm -rf lcov-out.info report + +cleanall: clean + rm -rf lcov-out.info report valgrind.out .PHONY: test diff --git a/coverage/bin/Makefile b/coverage/bin/Makefile index 2f2a9ee1..19bf254a 100644 --- a/coverage/bin/Makefile +++ b/coverage/bin/Makefile @@ -4,7 +4,7 @@ heredir = . basedir = ../.. -targets = afb-daemon-cov afb-client hi3.so hello.so salut.so salam.so shalom.so demat.so bug.so +targets = afb-daemon-cov afb-client hi3.so hello.so salut.so salam.so shalom.so demat.so bug.so hellov2.so binaries: $(targets) @@ -34,6 +34,7 @@ afb_daemon_defs = '-DAFB_VERSION="cov"' -DAGL_DEVEL -DWITH_MONITORING_OPTION '-D afb_client_srcs = $(srcdir)/main-afb-client-demo.c $(afb_clib_src) afb_client_defs = '-DAFB_VERSION="cov"' '-DBINDING_INSTALL_DIR="fake"' +hello2_src = $(samdir)/hello2.c hello3_src = $(samdir)/hello3.c hi_src = $(samdir)/hi3.c binding_flags = -shared -fPIC -Wl,--version-script=$(samdir)/export.map @@ -70,6 +71,10 @@ demat.so: $(hello3_src) @echo creation of $@ @gcc -o $@ $(hello3_src) '-DAPINAME="demat"' $(binding_flags) $(cflags) +hellov2.so: $(hello2_src) + @echo creation of $@ + @gcc -o $@ $(hello2_src) '-DAPINAME="hello-v2"' $(binding_flags) $(cflags) + bug.so: bug.c @echo creation of $@ @gcc -o $@ bug.c $(binding_flags) $(cflags) diff --git a/coverage/scripts/02-hello.sh b/coverage/scripts/02-hello.sh index 579a3f06..fe9040c2 100755 --- a/coverage/scripts/02-hello.sh +++ b/coverage/scripts/02-hello.sh @@ -6,6 +6,8 @@ HELLO PING false hello pIngNull true hello PingBug true hello PiNgJsOn {"well":"formed","json":[1,2,3,4.5,true,false,null,"oups"]} +hello call {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]} +hello callsync {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]} hello subcall {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]} hello subcall {"api":"hello","verb":"subcall","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}} hello subcallsync {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]} diff --git a/coverage/scripts/05-hello-v2.sh b/coverage/scripts/05-hello-v2.sh new file mode 100755 index 00000000..0cc54908 --- /dev/null +++ b/coverage/scripts/05-hello-v2.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +$R/bin/afb-client -s -e $WSURL <