Skip to content

Commit

Permalink
Merge pull request #51 from Ttibsi/cleanup-nonfunctional-coverage
Browse files Browse the repository at this point in the history
cleanup coverage generation as it doesn't work
  • Loading branch information
Ttibsi authored Oct 28, 2024
2 parents c1abf54 + 3d7d7b5 commit a10d318
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ set(CMAKE_C_COMPILER "/usr/bin/clang")

project(iris LANGUAGES CXX)
option(RUN_TESTS "Run unit tests" OFF)
option(ENABLE_COVERAGE "Generate coverage report" OFF)
option(ENABLE_ASAN "Compile with AddressSanitizer" OFF)
option(RELEASE "Release build" OFF)

Expand Down
20 changes: 2 additions & 18 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,10 @@ def clean() -> None:
pass


def test(testname: str | None, asan: bool, coverage: bool) -> None:
def test(testname: str | None, asan: bool) -> None:
compile_cmd = "cmake -G Ninja -DRUN_TESTS=true -S . -B build"
if asan:
compile_cmd += " -DENABLE_ASAN=true"
if coverage:
compile_cmd += " -DENABLE_COVERAGE=true"

run_shell_cmd(compile_cmd, debug=True)
run_shell_cmd("cmake --build build/")
Expand All @@ -59,19 +57,6 @@ def test(testname: str | None, asan: bool, coverage: bool) -> None:
env={"RAWTERM_DEBUG": "true"},
)

# if coverage:
# onlyfiles = [
# test_file
# for test_file in os.listdir("src/")
# if os.path.isfile(
# os.path.join("src/", test_file)
# ) and test_file.endswith(".cpp")
# ]
# for file in onlyfiles:
# run_shell_cmd(
# f"gcov -o build/src/CMakeFiles/iris_src.dir/ src/{file} -m -t",
# debug=True)


def build() -> None:
run_shell_cmd("cmake -G Ninja -S . -B build")
Expand All @@ -87,7 +72,6 @@ def main(argv: Sequence[str] | None = None) -> int:
test_parser.add_argument("testname", nargs="?", default=None)

test_parser.add_argument("--asan", action="store_true", default=False)
test_parser.add_argument("--coverage", action="store_true", default=False)

args: argparse.Namespace = parser.parse_args(argv)
print(args)
Expand All @@ -98,7 +82,7 @@ def main(argv: Sequence[str] | None = None) -> int:
elif args.cmd == "loc":
loc()
elif args.cmd == "test":
test(args.testname, args.asan, args.coverage)
test(args.testname, args.asan)
else:
build()

Expand Down
6 changes: 0 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,5 @@ if(ENABLE_ASAN)
target_link_libraries(iris_src PRIVATE -fsanitize=address)
endif()

if(ENABLE_COVERAGE)
message(STATUS "COVERAGE ENABLED")
add_compile_options(--coverage -g -O0)
add_link_options(--coverage)
endif()

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC rawterm iris_src)

0 comments on commit a10d318

Please sign in to comment.