diff --git a/tests/tools/libkcov/main.py b/tests/tools/libkcov/main.py index 5a619d1b..0eeedd41 100644 --- a/tests/tools/libkcov/main.py +++ b/tests/tools/libkcov/main.py @@ -113,10 +113,12 @@ def addTests(config, args, patterns): if not args.no_ptrace: test_loader.add_tests_from_module("test_system_mode") - test_loader.add_tests_from_module("test_accumulate") + if not args.no_ptrace: + test_loader.add_tests_from_module("test_accumulate") test_loader.add_tests_from_module("test_bash") test_loader.add_tests_from_module("test_filter") - test_loader.add_tests_from_module("test_python") + if not args.no_ptrace: + test_loader.add_tests_from_module("test_python") return test_loader.tests diff --git a/tests/tools/test_basic.py b/tests/tools/test_basic.py index 064020aa..dbc2ef5e 100644 --- a/tests/tools/test_basic.py +++ b/tests/tools/test_basic.py @@ -33,15 +33,3 @@ def runTest(self): dom = cobertura.parseFile(self.outbase + "/kcov/main/cobertura.xml") assert cobertura.hitsPerLine(dom, "second.py", 34) == 2 assert noKcovRv, rv - - -# Issue #414 -class outdir_is_executable(libkcov.TestCase): - def runTest(self): - # Running a system executable on Linux may cause ptrace to fails with - # "Operation not permitted", even with ptrace_scope set to 0. - # See https://www.kernel.org/doc/Documentation/security/Yama.txt - executable = self.sources + "/tests/python/short-test.py" - rv, o = self.do(self.kcov + " echo " + executable) - - assert rv == 0 diff --git a/tests/tools/test_compiled.py b/tests/tools/test_compiled.py index 3006c349..b8ee7262 100644 --- a/tests/tools/test_compiled.py +++ b/tests/tools/test_compiled.py @@ -572,3 +572,15 @@ def runTest(self): assert cobertura.hitsPerLine(dom, "sanitizer-coverage.c", 22) == 0 assert cobertura.hitsPerLine(dom, "sanitizer-coverage.c", 25) == 0 + + +# Issue #414 +class outdir_is_executable(libkcov.TestCase): + def runTest(self): + # Running a system executable on Linux may cause ptrace to fails with + # "Operation not permitted", even with ptrace_scope set to 0. + # See https://www.kernel.org/doc/Documentation/security/Yama.txt + executable = self.sources + "/tests/python/short-test.py" + rv, o = self.do(self.kcov + " echo " + executable) + + assert rv == 0