[CRIU] [PATCH] jenkins: build a coverage report if GCOV is set (v2)

Andrey Vagin avagin at openvz.org
Thu Mar 24 12:35:29 PDT 2016


From: Andrew Vagin <avagin at virtuozzo.com>

v2: set umask to 0000. It's required to generate gcda, gcno files
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/jenkins/criu-lib.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/jenkins/criu-lib.sh b/test/jenkins/criu-lib.sh
index 14ae9f3..bfbdc6b 100644
--- a/test/jenkins/criu-lib.sh
+++ b/test/jenkins/criu-lib.sh
@@ -1,9 +1,17 @@
+function exit_hook()
+{
+	test -z "$GCOV" && return
+	make gcov
+}
+
 function prep()
 {
 	# systemd executes jenkins in a separate sched cgroup.
 	echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/cpu.rt_runtime_us || true
 	echo 950000 > /sys/fs/cgroup/cpu,cpuacct/system/jenkins.service/cpu.rt_runtime_us || true
 
+	test -n "$GCOV" && umask 0000
+
 	ulimit -c unlimited &&
 	export CFLAGS=-g
 	git clean -dfx &&
@@ -11,7 +19,7 @@ function prep()
 	make -j 4 -C test/zdtm/ &&
 	make -C test zdtm_ct &&
 	mkdir -p test/report &&
-	true
+	trap exit_hook EXIT
 }
 
 function mount_tmpfs_to_dump()
-- 
2.5.0



More information about the CRIU mailing list