<commit_before>#
# GNU G++ options
#

set(CMAKE_CXX_FLAGS "-std=c++1z -Wall -Wextra -Weffc++ -Werror -pedantic -pipe")
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -ggdb -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")

if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
  # Ninja redirects build output and prints it only on error
  # Redirection strips colorization, so let's force it here
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
endif()


#
# Test coverage related stuff
#

if(SAL_COVERAGE)
  message(STATUS "Unittests coverage build")

  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -coverage")

  find_program(LCOV lcov)
  if(NOT LCOV)
    message(FATAL_ERROR "Executable lcov not found")
  endif()
  set(LCOV_ARGS
    --quiet
    --directory ${PROJECT_SOURCE_DIR}
    --rc lcov_branch_coverage=1
  )

  if(DEFINED ENV{GCOV})
    set(GCOV_TOOL $ENV{GCOV})
  else()
    set(GCOV_TOOL gcov)
  endif()
  find_program(GCOV ${GCOV_TOOL})
  if (NOT GCOV)
    message(FATAL_ERROR "Executable $ENV{GCOV} not found")
  endif()
  set(LCOV_ARGS ${LCOV_ARGS} --gcov-tool ${GCOV})

  find_program(GENHTML genhtml)
  if(NOT GENHTML)
    message(FATAL_ERROR "Executable genhtml not found")
  endif()

  add_custom_target(gen-cov
    DEPENDS unittests
    COMMENT "Generate coverage information"

    # Initialize coverage generation
    COMMAND ${LCOV} ${LCOV_ARGS} --zerocounters
    COMMAND ${LCOV} ${LCOV_ARGS} --initial --capture --no-external --derive-func-data --output-file sal-base.info
<commit_msg>tests: drop branch coverage temporarily, Travis-CI builds are timing out<commit_after>#
# GNU G++ options
#

set(CMAKE_CXX_FLAGS "-std=c++1z -Wall -Wextra -Weffc++ -Werror -pedantic -pipe")
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -ggdb -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")

if("${CMAKE_GENERATOR}" STREQUAL "Ninja")
  # Ninja redirects build output and prints it only on error
  # Redirection strips colorization, so let's force it here
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
endif()


#
# Test coverage related stuff
#

if(SAL_COVERAGE)
  message(STATUS "Unittests coverage build")

  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -coverage")

  find_program(LCOV lcov)
  if(NOT LCOV)
    message(FATAL_ERROR "Executable lcov not found")
  endif()
  set(LCOV_ARGS
    --quiet
    --directory ${PROJECT_SOURCE_DIR}
    --rc lcov_branch_coverage=0
  )

  if(DEFINED ENV{GCOV})
    set(GCOV_TOOL $ENV{GCOV})
  else()
    set(GCOV_TOOL gcov)
  endif()
  find_program(GCOV ${GCOV_TOOL})
  if (NOT GCOV)
    message(FATAL_ERROR "Executable $ENV{GCOV} not found")
  endif()
  set(LCOV_ARGS ${LCOV_ARGS} --gcov-tool ${GCOV})

  find_program(GENHTML genhtml)
  if(NOT GENHTML)
    message(FATAL_ERROR "Executable genhtml not found")
  endif()

  add_custom_target(gen-cov
    DEPENDS unittests
    COMMENT "Generate coverage information"

    # Initialize coverage generation
    COMMAND ${LCOV} ${LCOV_ARGS} --zerocounters
    COMMAND ${LCOV} ${LCOV_ARGS} --initial --capture --no-external --derive-func-data --output-file sal-base.info

{'fraction_non_alphanumeric': 0.12332351979064442, 'fraction_numerical': 0.0026169447170428526, 'mean_word_length': 4.263339070567986, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7100164', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1119, 'n_words': 265}