<commit_before>#
# Add a GTest based test target.
#
# An executable target is created with the source files, it is linked
# against GTest and added to the set of unit tests.
#
# .. note:: The test can be executed by calling the binary directly
#   or using: ``make run_tests_${PROJECT_NAME}_gtest_${target}``
#
# :param target: the target name
# :type target: string
# :param source_files: a list of source files used to build the test
#   executable
# :type source_files: list of strings
# :param WORKING_DIRECTORY: the working directory when executing the
#   executable
# :type FILE_PREFIX: string
# :param TIMEOUT: currently not supported
# :type FILE_PREFIX: integer
#
# @public
#
function(catkin_add_gtest target)
  if(NOT GTEST_FOUND AND NOT GTEST_FROM_SOURCE_FOUND)
    message(STATUS "skipping gtest '${target}' in project '${PROJECT_NAME}'")
    return()
  endif()

  # XXX look for optional TIMEOUT argument, #2645
  parse_arguments(_gtest "TIMEOUT;WORKING_DIRECTORY" "" ${ARGN})
  if(_gtest_TIMEOUT)
    message(WARNING "TIMEOUT argument to catkin_add_gtest() is ignored")
  endif()

  # create the executable, with basic + gtest build flags
  include_directories(${GTEST_INCLUDE_DIRS})
  link_directories(${GTEST_LIBRARY_DIRS})
  add_executable(${target} EXCLUDE_FROM_ALL ${_gtest_DEFAULT_ARGS})
  assert(${GTEST_LIBRARIES})
  target_link_libraries(${target} ${GTEST_LIBRARIES} ${THREADS_LIBRARY})

  # make sure gtest is built before the test target
  add_dependencies(${target} gtest gtest_main)
  # make sure the target is built before running tests
  add_dependencies(tests ${target})

  # XXX we DONT use rosunit to call the executable to get process control, #1629, #3112
  get_target_property(_target_path ${target} RUNTIME_OUTPUT_DIRECTORY)<commit_msg>fixed assertion for gtest libraries<commit_after>#
# Add a GTest based test target.
#
# An executable target is created with the source files, it is linked
# against GTest and added to the set of unit tests.
#
# .. note:: The test can be executed by calling the binary directly
#   or using: ``make run_tests_${PROJECT_NAME}_gtest_${target}``
#
# :param target: the target name
# :type target: string
# :param source_files: a list of source files used to build the test
#   executable
# :type source_files: list of strings
# :param WORKING_DIRECTORY: the working directory when executing the
#   executable
# :type FILE_PREFIX: string
# :param TIMEOUT: currently not supported
# :type FILE_PREFIX: integer
#
# @public
#
function(catkin_add_gtest target)
  if(NOT GTEST_FOUND AND NOT GTEST_FROM_SOURCE_FOUND)
    message(STATUS "skipping gtest '${target}' in project '${PROJECT_NAME}'")
    return()
  endif()

  # XXX look for optional TIMEOUT argument, #2645
  parse_arguments(_gtest "TIMEOUT;WORKING_DIRECTORY" "" ${ARGN})
  if(_gtest_TIMEOUT)
    message(WARNING "TIMEOUT argument to catkin_add_gtest() is ignored")
  endif()

  # create the executable, with basic + gtest build flags
  include_directories(${GTEST_INCLUDE_DIRS})
  link_directories(${GTEST_LIBRARY_DIRS})
  add_executable(${target} EXCLUDE_FROM_ALL ${_gtest_DEFAULT_ARGS})
  assert(GTEST_LIBRARIES)
  target_link_libraries(${target} ${GTEST_LIBRARIES} ${THREADS_LIBRARY})

  # make sure gtest is built before the test target
  add_dependencies(${target} gtest gtest_main)
  # make sure the target is built before running tests
  add_dependencies(tests ${target})

  # XXX we DONT use rosunit to call the executable to get process control, #1629, #3112
  get_target_property(_target_path ${target} RUNTIME_OUTPUT_DIRECTORY)
{'fraction_non_alphanumeric': 0.091164095371669, 'fraction_numerical': 0.006732117812061711, 'mean_word_length': 5.448462929475587, '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': '2604837', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1103, 'n_words': 371}