diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index f8d3584b..3e48cc90 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -159,25 +159,17 @@ add_executable(fork+exec fork/fork+exec.c) add_executable(thread-test threads/thread-main.c) target_link_libraries(thread-test ${CMAKE_THREAD_LIBS_INIT}) -#if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -# add_executable(sanitizer-coverage sanitizer-coverage.c) -# set_target_properties(sanitizer-coverage PROPERTIES COMPILE_FLAGS "-g -fsanitize=address -fsanitize-coverage=bb") -# set_target_properties(sanitizer-coverage PROPERTIES LINK_FLAGS "-fsanitize=address -fsanitize-coverage=bb") -#endif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + add_executable(sanitizer-coverage sanitizer-coverage.c) + set_target_properties(sanitizer-coverage PROPERTIES COMPILE_FLAGS "-g -fsanitize=address -fsanitize-coverage=bb") + set_target_properties(sanitizer-coverage PROPERTIES LINK_FLAGS "-fsanitize=address -fsanitize-coverage=bb") +endif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") add_executable (pie pie.c) -if (CMAKE_VERSION VERSION_LESS "2.8.9") - set_target_properties (pie PROPERTIES COMPILE_FLAGS -fPIE) -else (CMAKE_VERSION VERSION_LESS "2.8.9") - set_target_properties (pie PROPERTIES POSITION_INDEPENDENT_CODE ON) -endif (CMAKE_VERSION VERSION_LESS "2.8.9") +set_target_properties (pie PROPERTIES POSITION_INDEPENDENT_CODE ON) add_executable (pie-test argv-dependent.c) -if (CMAKE_VERSION VERSION_LESS "2.8.9") - set_target_properties (pie-test PROPERTIES COMPILE_FLAGS -fPIE) -else (CMAKE_VERSION VERSION_LESS "2.8.9") - set_target_properties (pie-test PROPERTIES POSITION_INDEPENDENT_CODE ON) -endif (CMAKE_VERSION VERSION_LESS "2.8.9") +set_target_properties (pie-test PROPERTIES POSITION_INDEPENDENT_CODE ON) if (NOT(CMAKE_SYSTEM_NAME STREQUAL "Darwin")) if (CMAKE_TARGET_ARCHITECTURES STREQUAL "i386" OR CMAKE_TARGET_ARCHITECTURES STREQUAL "x86_64") diff --git a/tests/tools/test_compiled.py b/tests/tools/test_compiled.py index 5c0599eb..96eb8ade 100644 --- a/tests/tools/test_compiled.py +++ b/tests/tools/test_compiled.py @@ -1,6 +1,7 @@ import os import platform import sys +import time import unittest import libkcov @@ -100,7 +101,7 @@ def runTest(self): assert rv == 99 -class Pie(libkcov.TestCase): +class pie(libkcov.TestCase): def runTest(self): noKcovRv, o = self.doCmd(self.binaries + "/pie") rv, o = self.do(self.kcov + " " + self.outbase + "/kcov " + self.binaries + "/pie", False) @@ -180,9 +181,6 @@ def runTest(self): class SignalsBase(libkcov.TestCase): - def SignalsBase(): - self.m_self = "" - def cmpOne(self, sig): noKcovRv, o = self.doCmd(self.binaries + "/signals " + sig + " " + self.m_self) rv, o = self.do( @@ -270,7 +268,7 @@ def runTest(self): try: dom = cobertura.parseFile(self.outbase + "/kcov/main-tests/cobertura.xml") self.fail("File unexpectedly found") - except: + except Exception: # Exception is expected here pass @@ -570,8 +568,8 @@ class address_sanitizer_coverage(libkcov.TestCase): @unittest.expectedFailure def runTest(self): if not os.path.isfile(self.binaries + "/sanitizer-coverage"): - self.write_message("Clang-only") - assert False + self.skipTest("Clang only") + rv, o = self.do( self.kcov + " --clang " diff --git a/tests/tools/test_python.py b/tests/tools/test_python.py index ee0a6075..d6443e5f 100644 --- a/tests/tools/test_python.py +++ b/tests/tools/test_python.py @@ -117,7 +117,7 @@ def doTest(self, extra): class python_coverage(PythonBase): - def runTestTest(self): + def runTest(self): self.doTest("")