aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build-data/platforms/vpp.mk5
-rwxr-xr-xsrc/vlib/unix/main.c11
-rw-r--r--test/framework.py2
-rw-r--r--test/test_vcl.py2
4 files changed, 15 insertions, 5 deletions
diff --git a/build-data/platforms/vpp.mk b/build-data/platforms/vpp.mk
index ffafe861294..97484802581 100644
--- a/build-data/platforms/vpp.mk
+++ b/build-data/platforms/vpp.mk
@@ -37,9 +37,8 @@ vpp_clang_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_clang_TAG_CXXFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_clang_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
-vpp_gcov_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -fPIC -Werror -fprofile-arcs -ftest-coverage
-vpp_gcov_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -fPIC -Werror -coverage
+vpp_gcov_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DCLIB_GCOV -fPIC -Werror -fprofile-arcs -ftest-coverage
+vpp_gcov_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DCLIB_GCOV -fPIC -Werror -coverage
vpp_coverity_TAG_CFLAGS = -g -O2 -fPIC -Werror -D__COVERITY__
vpp_coverity_TAG_LDFLAGS = -g -O2 -fPIC -Werror -D__COVERITY__
-
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index ed909b65feb..82de8ec7632 100755
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -139,6 +139,17 @@ unix_signal_handler (int signum, siginfo_t * si, ucontext_t * uc)
break;
}
+#ifdef CLIB_GCOV
+ /*
+ * Test framework sends SIGTERM, so we need to flush the
+ * code coverage stats here.
+ */
+ {
+ void __gcov_flush (void);
+ __gcov_flush ();
+ }
+#endif
+
/* Null terminate. */
vec_add1 (syslog_msg, 0);
diff --git a/test/framework.py b/test/framework.py
index 25db2b72b34..4ce8bc1380d 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -530,7 +530,7 @@ class VppTestCase(unittest.TestCase):
cls.vpp.poll()
if cls.vpp.returncode is None:
cls.logger.debug("Sending TERM to vpp")
- cls.vpp.kill()
+ cls.vpp.terminate()
cls.logger.debug("Waiting for vpp to die")
cls.vpp.communicate()
cls.logger.debug("Deleting class vpp attribute on %s",
diff --git a/test/test_vcl.py b/test/test_vcl.py
index feb4e39120c..269a96107b2 100644
--- a/test/test_vcl.py
+++ b/test/test_vcl.py
@@ -202,7 +202,7 @@ class VCLTestCase(VppTestCase):
if os.path.isdir('/proc/{}'.format(worker_server.process.pid)):
self.logger.info("Killing server worker process (pid %d)" %
worker_server.process.pid)
- os.killpg(os.getpgid(worker_server.process.pid), signal.SIGKILL)
+ os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM)
worker_server.join()
self.logger.info("Client worker result is `%s'" % worker_client.result)
error = False