coverage: Improve testing 11/15111/2
authorJose Bollo <jose.bollo@iot.bzh>
Fri, 6 Jul 2018 15:07:19 +0000 (17:07 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Sun, 8 Jul 2018 19:27:48 +0000 (21:27 +0200)
- Add test of bindings v2
- Distinguish between clean and cleanall
- More valgrind ouput

Change-Id: If929756d9d35ddb959b46f7330cbf318301d532e
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
coverage/.gitignore [new file with mode: 0644]
coverage/Makefile
coverage/bin/Makefile
coverage/scripts/02-hello.sh
coverage/scripts/05-hello-v2.sh [new file with mode: 0755]
coverage/scripts/run-test.sh

diff --git a/coverage/.gitignore b/coverage/.gitignore
new file mode 100644 (file)
index 0000000..43d04cb
--- /dev/null
@@ -0,0 +1,3 @@
+lcov-out.info
+report/
+valgrind.out
index 219321c..3f5f3ce 100644 (file)
@@ -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
 
index 2f2a9ee..19bf254 100644 (file)
@@ -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)
index 579a3f0..fe9040c 100755 (executable)
@@ -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 (executable)
index 0000000..0cc5490
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+$R/bin/afb-client -s -e $WSURL <<EOC
+hello-v2 ping true
+HELLO-v2 PING false
+hello-v2 pIngNull true
+hello-v2 PingBug true
+hello-v2 PiNgJsOn {"well":"formed","json":[1,2,3,4.5,true,false,null,"oups"]}
+hello-v2 call {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
+hello-v2 callsync {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
+hello-v2 subcall {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
+hello-v2 subcall {"api":"hello","verb":"subcall","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello-v2 subcallsync {"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}
+hello-v2 subcallsync {"api":"hello","verb":"subcall","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello-v2 subcall {"api":"hello","verb":"subcallsync","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello-v2 subcallsync {"api":"hello","verb":"subcallsync","args":{"api":"hello","verb":"pingjson","args":[{"key1":"value1"}]}}
+hello-v2 eventadd {"tag":"ev1","name":"event-A"}
+hello-v2 eventadd {"tag":"ev2","name":"event-B"}
+hello-v2 eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello-v2 eventpush {"tag":"ev2","data":{"item":0}}
+hello-v2 eventsub {"tag":"ev2"}
+hello-v2 eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello-v2 eventpush {"tag":"ev2","data":{"item":0}}
+hello-v2 eventsub {"tag":"ev1"}
+hello-v2 subcall {"api":"hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"hello"]}}
+hello-v2 subcall {"api":"hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
+hello-v2 subcallsync {"api":"hello","verb":"eventpush","args":{"tag":"ev1","data":[1,2,"hello"]}}
+hello-v2 subcallsync {"api":"hello","verb":"eventpush","args":{"tag":"ev2","data":{"item":0}}}
+hello-v2 eventunsub {"tag":"ev2"}
+hello-v2 eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello-v2 eventpush {"tag":"ev2","data":{"item":0}}
+hello-v2 eventdel {"tag":"ev1"}
+hello-v2 eventpush {"tag":"ev1","data":[1,2,"hello"]}
+hello-v2 eventpush {"tag":"ev2","data":{"item":0}}
+hello-v2 broadcast {"name":"xev","data":"true"}
+hello-v2 broadcast {"tag":"ev2","data":"true"}
+hello-v2 eventdel {"tag":"ev2"}
+hello-v2 hasperm {"perm":"some-permissison"}
+hello-v2 appid true
+hello-v2 uid true
+hello-v2 set-loa 1
+hello-v2 set-loa 3
+hello-v2 close true
+hello-v2 setctx "some-text-0"
+hello-v2 setctxif "some-text-1"
+hello-v2 getctx 
+hello-v2 setctx "some-text-2"
+hello-v2 getctx
+hello-v2 info
+hello-v2 verbose {"level":2,"message":"hello"}
+EOC
+
index 26ade87..34c2d30 100755 (executable)
@@ -14,6 +14,7 @@ valgrind \
        --trace-children=no \
        --track-fds=yes \
        --leak-check=full \
+        --show-leak-kinds=all \
 $R/bin/afb-daemon-cov \
        --verbose \
        --verbose \