summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/framework.py7
-rw-r--r--test/test_bihash.py4
-rw-r--r--test/test_vlib.py6
3 files changed, 14 insertions, 3 deletions
diff --git a/test/framework.py b/test/framework.py
index 872dd45d86b..46f7542ea54 100644
--- a/test/framework.py
+++ b/test/framework.py
@@ -217,6 +217,13 @@ def _running_extended_tests():
running_extended_tests = _running_extended_tests()
+def _running_gcov_tests():
+ return BoolEnvironmentVariable("GCOV_TESTS")
+
+
+running_gcov_tests = _running_gcov_tests()
+
+
def _running_on_centos():
os_id = os.getenv("OS_ID", "")
return True if "centos" in os_id.lower() else False
diff --git a/test/test_bihash.py b/test/test_bihash.py
index 04b1b4f635a..ac8bab37a7d 100644
--- a/test/test_bihash.py
+++ b/test/test_bihash.py
@@ -2,7 +2,7 @@
import unittest
-from framework import VppTestCase, VppTestRunner
+from framework import VppTestCase, VppTestRunner, running_gcov_tests
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
@@ -50,6 +50,7 @@ class TestBihash(VppTestCase):
self.logger.critical(error)
self.assertNotIn('failed', error)
+ @unittest.skipUnless(running_gcov_tests, "part of code coverage tests")
def test_bihash_coverage(self):
""" Improve Code Coverage """
@@ -60,6 +61,5 @@ class TestBihash(VppTestCase):
self.logger.critical(error)
self.assertNotIn('failed', error)
-
if __name__ == '__main__':
unittest.main(testRunner=VppTestRunner)
diff --git a/test/test_vlib.py b/test/test_vlib.py
index 82cf6abc421..3c6288c8eb1 100644
--- a/test/test_vlib.py
+++ b/test/test_vlib.py
@@ -3,6 +3,7 @@
import unittest
from framework import VppTestCase, VppTestRunner, running_extended_tests
+from framework import running_gcov_tests
from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
@@ -24,7 +25,7 @@ class TestVlib(VppTestCase):
def tearDown(self):
super(TestVlib, self).tearDown()
- @unittest.skipUnless(running_extended_tests, "part of extended tests")
+ @unittest.skipUnless(running_gcov_tests, "part of code coverage tests")
def test_vlib_main_unittest(self):
""" Vlib main.c Code Coverage Test """
@@ -66,6 +67,7 @@ class TestVlib(VppTestCase):
else:
self.logger.info(cmd + " FAIL retval " + str(r.retval))
+ @unittest.skipUnless(running_gcov_tests, "part of code coverage tests")
def test_vlib_node_cli_unittest(self):
""" Vlib node_cli.c Code Coverage Test """
@@ -110,6 +112,7 @@ class TestVlib(VppTestCase):
else:
self.logger.info(cmd + " FAIL retval " + str(r.retval))
+ @unittest.skipUnless(running_gcov_tests, "part of code coverage tests")
def test_vlib_buffer_c_unittest(self):
""" Vlib buffer.c Code Coverage Test """
@@ -165,6 +168,7 @@ class TestVlib(VppTestCase):
else:
self.logger.info(cmd + " FAIL retval " + str(r.retval))
+ @unittest.skipUnless(running_gcov_tests, "part of code coverage tests")
def test_vlib_format_unittest(self):
""" Vlib format.c Code Coverage Test """