<commit_before>find_package(Threads REQUIRED)
find_package(GTest)

set(CMAKE_BUILD_TYPE Debug)


if(NOT GTEST_FOUND)
  message(FATAL_ERROR "GTest/GMock was not found
 $ cd /usr/src/gtest
 $ sudo cmake -E make_directory build && sudo cmake -E chdir build cmake .. && sudo cmake --build build
 $ sudo cp build/libgtest* /usr/local/lib/ && sudo rm -rf build
 $ cd /usr/src/gmock
 $ sudo cmake -E make_directory build && sudo cmake -E chdir build cmake .. && sudo cmake --build build
 $ sudo cp build/libgmock* /usr/local/lib/ && sudo rm -rf build")
endif()

include_directories(${GTEST_INCLUDE_DIRS})

set(GMOCK_LIBRARIES "gmock")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings") # various warning flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") # debug, no optimisation
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") # enabling coverage

# adding source to test executable
add_executable(tests
  test.cpp                 # main
  Arduino.cpp              # define few arduino-like functions
  test-AsyncComm.cpp
  test-RingBuffer.cpp
  )

# enable C++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../RingBuffer/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../AsyncComm/)

target_link_libraries(tests ${GTEST_BOTH_LIBRARIES})
target_link_libraries(tests ${GMOCK_LIBRARIES})
target_link_libraries(tests ${CMAKE_THREAD_LIBS_INIT})

add_test(AllTests tests)<commit_msg>adding conf for local coverage with lcov<commit_after>find_package(Threads REQUIRED)
find_package(GTest)

set(CMAKE_BUILD_TYPE Debug)


if(NOT GTEST_FOUND)
  message(FATAL_ERROR "GTest/GMock was not found
 $ cd /usr/src/gtest
 $ sudo cmake -E make_directory build && sudo cmake -E chdir build cmake .. && sudo cmake --build build
 $ sudo cp build/libgtest* /usr/local/lib/ && sudo rm -rf build
 $ cd /usr/src/gmock
 $ sudo cmake -E make_directory build && sudo cmake -E chdir build cmake .. && sudo cmake --build build
 $ sudo cp build/libgmock* /usr/local/lib/ && sudo rm -rf build")
endif()

include_directories(${GTEST_INCLUDE_DIRS})

set(GMOCK_LIBRARIES "gmock")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings") # various warning flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") # debug, no optimisation
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") # enabling coverage

# adding source to test executable
add_executable(tests
  test.cpp                 # main
  Arduino.cpp              # define few arduino-like functions
  test-AsyncComm.cpp
  test-RingBuffer.cpp
  )

# enable C++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../RingBuffer/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../AsyncComm/)

target_link_libraries(tests ${GTEST_BOTH_LIBRARIES})
target_link_libraries(tests ${GMOCK_LIBRARIES})
target_link_libraries(tests ${CMAKE_THREAD_LIBS_INIT})

add_test(AllTests tests)

if (LOCAL_COVERAGE)
  set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
  if(CMAKE_COMPILER_IS_GNUCXX)
    include(CodeCoverage)
    setup_target_for_coverage(tests_coverage ctest coverage)
  endif()
endif()
{'fraction_non_alphanumeric': 0.11477272727272728, 'fraction_numerical': 0.002840909090909091, 'mean_word_length': 5.008532423208191, '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': '313118', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1227, 'n_words': 266}