<commit_before>cmake_minimum_required(VERSION 2.6)

set ( MCODE_TOP ${CMAKE_SOURCE_DIR}/../../ )

option ( MCODE_COVERAGE "Enable code coverage" ON )

# Locate GTest
find_package(GTest REQUIRED)
include_directories(
  ${GTEST_INCLUDE_DIRS}
  ${MCODE_TOP}/src
  ${PROJECT_BINARY_DIR}/include/)

set (
  SRC_LIST
  # Source code files
  ${MCODE_TOP}/src/common/utils.c
  ${MCODE_TOP}/src/common/mstring.c
)

set (
  TEST_SRC_LIST
  # Test source code files
  ${MCODE_TOP}/src/gtest/wrap-mocks.cpp
  ${MCODE_TOP}/src/gtest/gtest-main.cpp
  ${MCODE_TOP}/src/gtest/test-strings-basic.cpp
  ${MCODE_TOP}/src/gtest/test-strings-mocked.cpp
)

configure_file ( ${MCODE_TOP}/mcode-config.h.in
  ${PROJECT_BINARY_DIR}/include/mcode-config.h
)

add_library ( console-test.lib STATIC ${SRC_LIST})
if ( MCODE_COVERAGE )
  target_compile_options ( console-test.lib PRIVATE "-fprofile-arcs" "-ftest-coverage" )
  target_link_libraries ( console-test.lib gcov )
endif ( MCODE_COVERAGE )

add_executable(console-test.test ${TEST_SRC_LIST})

#if ( MCODE_COVERAGE )
#  target_compile_options(console-test.test PRIVATE "-fprofile-arcs" "-ftest-coverage")
#endif ( MCODE_COVERAGE )

target_link_libraries(console-test.test ${GTEST_LIBRARIES} gmock pthread console-test.lib "-Wl,--wrap,uart_write_char")
#if ( MCODE_COVERAGE )
#  target_link_libraries(console-test.test gcov )
#endif ( MCODE_COVERAGE )<commit_msg>Clean up a bit<commit_after>cmake_minimum_required(VERSION 2.6)

set ( MCODE_TOP ${CMAKE_SOURCE_DIR}/../../ )

option ( MCODE_COVERAGE "Enable code coverage" ON )

# Locate GTest
find_package(GTest REQUIRED)
include_directories(
  ${GTEST_INCLUDE_DIRS}
  ${MCODE_TOP}/src
  ${PROJECT_BINARY_DIR}/include/)

set (
  SRC_LIST
  # Source code files
  ${MCODE_TOP}/src/common/utils.c
  ${MCODE_TOP}/src/common/mstring.c
)

set (
  TEST_SRC_LIST
  # Test source code files
  ${MCODE_TOP}/src/gtest/wrap-mocks.cpp
  ${MCODE_TOP}/src/gtest/gtest-main.cpp
  ${MCODE_TOP}/src/gtest/test-strings-basic.cpp
  ${MCODE_TOP}/src/gtest/test-strings-mocked.cpp
)

configure_file ( ${MCODE_TOP}/mcode-config.h.in
  ${PROJECT_BINARY_DIR}/include/mcode-config.h
)

add_library ( console-test.lib STATIC ${SRC_LIST})
if ( MCODE_COVERAGE )
  target_compile_options ( console-test.lib PRIVATE "-fprofile-arcs" "-ftest-coverage" )
  target_link_libraries ( console-test.lib gcov )
endif ( MCODE_COVERAGE )

add_executable(console-test.test ${TEST_SRC_LIST})

target_link_libraries(console-test.test ${GTEST_LIBRARIES} gmock pthread console-test.lib "-Wl,--wrap,uart_write_char")
{'fraction_non_alphanumeric': 0.13668499607227022, 'fraction_numerical': 0.0015710919088766694, 'mean_word_length': 4.97887323943662, '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': '1979106', 'n_tokens_mistral': 1012, 'n_tokens_neox': 990, 'n_words': 143}