<commit_before># Copyright 2006-2008 The FLWOR Foundation.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
# http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Adds a test to the project.
#
# Syntax:
#
#   ZORBA_ADD_TEST_SIMPLE(NAME TARGET ...) 
#   
#     NAME - the name of the added test
#     TARGET - target that will be executed when the test is run
#     ... - arguments that will be passed to the target
#
MACRO(ZORBA_ADD_TEST_SIMPLE NAME TARGET ...)
  SET(ARGS ${ARGV2} ${ARGN})
	IF(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
		GET_TARGET_PROPERTY(TARGET_LOCATION "${TARGET}" LOCATION)
		ADD_TEST("${NAME}" "${TARGET_LOCATION}" ${ARGS})
	ELSE(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
		GET_TARGET_PROPERTY(TARGET_LOCATION "${TARGET}" LOCATION)
		IF(WIN32)
			ADD_TEST("${NAME}" "${WIN_CMAKE_BINARY_DIR}/scripts/win_exec_cmake.bat" "${TARGET_LOCATION}" ${ARGS})
		ELSE(WIN32)
			ADD_TEST("${NAME}" "${TARGET_LOCATION}" ${ARGS})
		ENDIF(WIN32)
	ENDIF(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
  SET_TESTS_PROPERTIES ("${NAME}" PROPERTIES TIMEOUT "${NORMAL_TIMEOUT_VALUE}")
ENDMACRO(ZORBA_ADD_TEST_SIMPLE)

# This macro easies the process of adding test for store dependent executables 
# (e.g. if the rbkt tests must be added for the executables testdriver and testdriver_firststore). 
# It adds one test for each store registered. It has the same naming convection for the target as 
# the macro that is used to generated store dependent executables (thus, 
# 'testdriver' must be passed as TARGET if the test should be executed with the executables
# testdriver and testdriver_firststore).
#
# Syntax:
#
#   ZORBA_ADD_TEST_SIMPLE(NAME TARGET ...) 
#   
#     NAME - the name of the added test
#     TARGET - target that will be executed when the test is run. For each registered store, 
#              a suffix will be added to the target 
#              (similar convention than in ZORBA_GENERATE_STORE_SPECIFIC_EXES)
#     ... - arguments that will be passed to the target
#
MACRO(ZORBA_ADD_TEST_ALLSTORES NAME TARGET ...)
  SET(ARGS ${ARGV2} ${ARGN})
  FOREACH(ZORBA_STORE_NAME ${ZORBA_STORE_NAMES})
    # simplestore executable doesn't need an extension
    SET(SUFFIX)
    IF (NOT ${ZORBA_STORE_NAME} STREQUAL "simplestore")
      SET(SUFFIX "_${ZORBA_STORE_NAME}")
    ENDIF (NOT ${ZORBA_STORE_NAME} STREQUAL "simplestore")
    ZORBA_ADD_TEST_SIMPLE("${NAME}${SUFFIX}" "${TARGET}${SUFFIX}" ${ARGS})
  ENDFOREACH(ZORBA_STORE_NAME ${ZORBA_STORE_NAMES})
ENDMACRO(ZORBA_ADD_TEST_ALLSTORES)

# This macro can be used to set a property to each test generated by the macro ZORBA_ADD_TEST_ALLSTORES.
#
# Syntax:
#
#   ZORBA_SET_TEST_PROPERTY_ALLSTORES(NAME PROPERTY VALUE) 
#   
#     PROPERTY - property<commit_msg>if building the static library (i.e. by setting ZORBA_BUILD_STATIC_LIBRARY to ON) all tests are executed using the according "static" executables (e.g. testdriver_static)<commit_after># Copyright 2006-2008 The FLWOR Foundation.
# 
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# 
# http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Adds a test to the project.
#
# Syntax:
#
#   ZORBA_ADD_TEST_SIMPLE(NAME TARGET ...) 
#   
#     NAME - the name of the added test
#     TARGET - target that will be executed when the test is run
#     ... - arguments that will be passed to the target
#
MACRO(ZORBA_ADD_TEST_SIMPLE NAME TARGET ...)
  SET(ARGS ${ARGV2} ${ARGN})

	IF(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
		GET_TARGET_PROPERTY(TARGET_LOCATION "${TARGET}" LOCATION)

    # if building the static library, always use the static executables for testing
    IF (ZORBA_BUILD_STATIC_LIBRARY)
      SET(TARGET_LOCATION "${TARGET_LOCATION}_static")
    ENDIF (ZORBA_BUILD_STATIC_LIBRARY)

		ADD_TEST("${NAME}" "${TARGET_LOCATION}" ${ARGS})
	ELSE(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
		GET_TARGET_PROPERTY(TARGET_LOCATION "${TARGET}" LOCATION)
		IF(WIN32)
			ADD_TEST("${NAME}" "${WIN_CMAKE_BINARY_DIR}/scripts/win_exec_cmake.bat" "${TARGET_LOCATION}" ${ARGS})
		ELSE(WIN32)
      # if building the static library, always use the static executables for testing
      IF (ZORBA_BUILD_STATIC_LIBRARY)
        SET(TARGET_LOCATION "${TARGET_LOCATION}_static")
      ENDIF (ZORBA_BUILD_STATIC_LIBRARY)
			ADD_TEST("${NAME}" "${TARGET_LOCATION}" ${ARGS})
		ENDIF(WIN32)
	ENDIF(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
  SET_TESTS_PROPERTIES ("${NAME}" PROPERTIES TIMEOUT "${NORMAL_TIMEOUT_VALUE}")
ENDMACRO(ZORBA_ADD_TEST_SIMPLE)

# This macro easies the process of adding test for store dependent executables 
# (e.g. if the rbkt tests must be added for the executables testdriver and testdriver_firststore). 
# It adds one test for each store registered. It has the same naming convection for the target as 
# the macro that is used to generated store dependent executables (thus, 
# 'testdriver' must be passed as TARGET if the test should be executed with the executables
# testdriver and testdriver_firststore).
#
# Syntax:
#
#   ZORBA_ADD_TEST_SIMPLE(NAME TARGET ...) 
#   
#     NAME - the name of the added test
#     TARGET - target that will be executed when the test is run. For each registered store, 
#              a suffix will be added to the target 
#              (similar convention than in ZORBA_GENERATE_STORE_SPECIFIC_EXES)
#     ... - arguments that will be passed to the target
#
MACRO(ZORBA_ADD_TEST_ALLSTORES NAME TARGET ...)
  SET(ARGS ${ARGV2} ${ARGN})
  FOREACH(ZORBA_STORE_NAME ${ZORBA_STORE_NAMES})
    # simplestore executable doesn't need an extension
    SET(SUFFIX)
    IF (NOT ${ZORBA_STORE_NAME} STREQUAL "simplestore")
      SET(SUFFIX "_${ZORBA_STORE_NAME}")
    ENDIF (NOT ${ZORBA_STORE_NAME} STREQUAL "simplestore")

    ZORBA_ADD_TEST_SIMPLE("${NAME}${SUFFIX}" "${TARGET}${SUFFIX}" ${ARGS})
  ENDFOREACH(ZORBA_STORE_NAME ${ZORBA_STORE_NAMES})
ENDMACRO(ZORBA_ADD_TEST_ALLSTORES)

# This macro can be used to set a property to each test generated by the macro ZORBA_ADD_TEST_ALLSTORES.
#
# Syntax:
#
#   ZORBA_SET_TEST_PROPERTY_ALLSTORES(NAME PROPERTY VALUE) 
#   
#     PROPERTY - property
{'fraction_non_alphanumeric': 0.09181463837158943, 'fraction_numerical': 0.0057745055579616, 'mean_word_length': 4.4637223974763405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3200203', 'n_tokens_mistral': 2393, 'n_tokens_neox': 2283, 'n_words': 712}