diff --git a/cmake/macros.cmake b/cmake/macros.cmake index 1fcccf41..2d655bc1 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -93,6 +93,7 @@ function(malt_print_status) message(STATUS "| gcc-coverage : ${ENABLE_GCC_COVERAGE}") message(STATUS "| valgrind : ${ENABLE_VALGRIND}") message(STATUS "--------------------------------------------------------------") + message(STATUS "| openmp : ${OpenMP_CXX_FLAGS}") message(STATUS "| libunwind : ${LIBUNWIND_LIBRARIES}") message(STATUS "| libelf : ${LIBELF_LIBRARY}") #message(STATUS "| iniparser : ${INIPARSER_LIBRARY}") diff --git a/dev/common.py b/dev/common.py index fd2ea70a..2990a77b 100644 --- a/dev/common.py +++ b/dev/common.py @@ -37,6 +37,11 @@ def run_shell(cmd: str) -> None: cprint(f" + {cmd}", "light_blue") subprocess.run(cmd, shell=True, check=True) +############################################################ +def run_shell_cmds(cmds: list) -> None: + for cmd in cmds: + run_shell(cmd) + ############################################################ @contextmanager def jump_in_dir(path: str): diff --git a/dev/gen-coverage.sh b/dev/gen-coverage.py similarity index 56% rename from dev/gen-coverage.sh rename to dev/gen-coverage.py index c1bfc105..b7f95cb4 100755 --- a/dev/gen-coverage.sh +++ b/dev/gen-coverage.py @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env python3 ############################################################ # PROJECT : MALT (MALoc Tracker) # VERSION : 1.2.4 @@ -14,10 +14,19 @@ # coverage results ############################################################ -set -e -set -x +from common import print_exception, run_shell_cmds ############################################################ -lcov -o out.info -c -d . -lcov -o out.info --remove out.info '/usr/*' '*/Test*' '*/tests/*' '*/extern-deps/*' -genhtml -o html out.info +def malt_gen_coverage() -> None: + run_shell_cmds([ + "lcov -o out.info -c -d .", + "lcov -o out.info --remove out.info '/usr/*' '*/Test*' '*/tests/*' '*/extern-deps/*'", + "genhtml -o html out.info" + ]) + +############################################################ +if __name__ == "__main__": + try: + malt_gen_coverage() + except Exception as e: + print_exception(e)