<commit_before>
#
# unit test source files
#
set (CVMFS_UNITTEST_SOURCES
  main.cc

  t_atomic.cc
  t_smallhash.cc
)

#
# build googletest framework
#
include (${GOOGLETEST_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GOOGLETEST_BUILTIN_LOCATION}/include)

#
# Compiler and Linker Flags for unit tests
#
set (CVMFS_UNITTESTS_CFLAGS "${CVMFS_UNITTESTS_CFLAGS} -I ${CMAKE_SOURCE_DIR}/cvmfs")
set (CVMFS_UNITTESTS_LD_FLAGS "${CVMFS_UNITTESTS_LD_FLAGS}")

#
# build CernVM-FS test cases
#
add_executable (cvmfs_unittests ${CVMFS_UNITTEST_SOURCES})
add_dependencies (cvmfs_unittests googletest)

set_target_properties (cvmfs_unittests PROPERTIES COMPILE_FLAGS "${CVMFS_UNITTESTS_CFLAGS}" LINK_FLAGS "${CVMFS_UNITTESTS_LD_FLAGS}")

# link the stuff (*_LIBRARIES are dynamic link libraries)
target_link_libraries (cvmfs_unittests ${GOOGLETEST_ARCHIVE} pthread)
<commit_msg>add googletest binary to 'make test'<commit_after>
#
# global test configuration
#
set (PROJECT_TEST_NAME "${PROJECT_NAME}_test")

#
# unit test source files
#
set (CVMFS_UNITTEST_SOURCES
  main.cc

  t_atomic.cc
  t_smallhash.cc
)

#
# build googletest framework
#
include (${GOOGLETEST_BUILTIN_LOCATION}/CVMFS-CMakeLists.txt)
set (INCLUDE_DIRECTORIES ${INCLUDE_DIRECTORIES} ${GOOGLETEST_BUILTIN_LOCATION}/include)

#
# Compiler and Linker Flags for unit tests
#
set (CVMFS_UNITTESTS_CFLAGS "${CVMFS_UNITTESTS_CFLAGS} -I ${CMAKE_SOURCE_DIR}/cvmfs")
set (CVMFS_UNITTESTS_LD_FLAGS "${CVMFS_UNITTESTS_LD_FLAGS}")

#
# build CernVM-FS test cases
#
add_executable (${PROJECT_TEST_NAME} ${CVMFS_UNITTEST_SOURCES})
add_dependencies (${PROJECT_TEST_NAME} googletest)

set_target_properties (${PROJECT_TEST_NAME} PROPERTIES COMPILE_FLAGS "${CVMFS_UNITTESTS_CFLAGS}" LINK_FLAGS "${CVMFS_UNITTESTS_LD_FLAGS}")

# link the stuff (*_LIBRARIES are dynamic link libraries)
target_link_libraries (${PROJECT_TEST_NAME} ${GOOGLETEST_ARCHIVE} pthread)

#
# Integrate the test running into CMake
#
add_test (NAME unittests COMMAND ${PROJECT_TEST_NAME})

{'fraction_non_alphanumeric': 0.09877750611246944, 'fraction_numerical': 0.0, 'mean_word_length': 7.934497816593886, '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': '3925695', 'n_tokens_mistral': 812, 'n_tokens_neox': 783, 'n_words': 148}