<commit_before>#
# Copyright 2014-2016 CyberVision, Inc.
#
# 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.
#

if(KAA_UNITTESTS_COMPILE)
    find_package(cmocka REQUIRED)
    find_program(MEMORYCHECK_COMMAND valgrind)
    set(MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-reachable=yes --trace-children=yes -v")

    include(CTest)
endif()

################################################################################
# Creates an unit test with given name and dependencies.
#
# TODO: move this function to the separate module, after new design will be implemented.
#       When new SDK build system will be ready, tests will be encapsulated
#       within each production module. Test system helpers, like this function
#       will be moved to separate cmake build modules or scripts.
#
# Syntax:
# kaa_add_unit_test(NAME test_name
#                   SOURCES test_sources_files...
#                   [DEPENDS list_of_dependencies...]
#                   [INC_DIRS list_of_include_directories...])
function(kaa_add_unit_test)
    if(KAA_UNITTESTS_COMPILE)
        cmake_parse_arguments(
            UNIT_TEST
            ""
            "NAME"
            "SOURCES;DEPENDS;INC_DIRS"
            ${ARGN})

        if (NOT DEFINED UNIT_TEST_NAME AND DEFINED UNIT_TEST_SOURCES)
            message(FATAL_ERROR "Test sources and name must be defined!")
        endif()<commit_msg>KAA-1348 Fix unknown CMake command cmake_parse_arguments<commit_after>#
# Copyright 2014-2016 CyberVision, Inc.
#
# 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.
#

if(KAA_UNITTESTS_COMPILE)
    find_package(cmocka REQUIRED)
    find_program(MEMORYCHECK_COMMAND valgrind)
    set(MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-reachable=yes --trace-children=yes -v")

    include(CTest)
    include(CMakeParseArguments)
endif()

################################################################################
# Creates an unit test with given name and dependencies.
#
# TODO: move this function to the separate module, after new design will be implemented.
#       When new SDK build system will be ready, tests will be encapsulated
#       within each production module. Test system helpers, like this function
#       will be moved to separate cmake build modules or scripts.
#
# Syntax:
# kaa_add_unit_test(NAME test_name
#                   SOURCES test_sources_files...
#                   [DEPENDS list_of_dependencies...]
#                   [INC_DIRS list_of_include_directories...])
function(kaa_add_unit_test)
    if(KAA_UNITTESTS_COMPILE)
        cmake_parse_arguments(
            UNIT_TEST
            ""
            "NAME"
            "SOURCES;DEPENDS;INC_DIRS"
            ${ARGN})

        if (NOT DEFINED UNIT_TEST_NAME AND DEFINED UNIT_TEST_SOURCES)
            message(FATAL_ERROR "Test sources and name must be defined!")
        endif()
{'fraction_non_alphanumeric': 0.112006237006237, 'fraction_numerical': 0.007276507276507277, 'mean_word_length': 3.2861915367483294, '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': '5391112', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1048, 'n_words': 369}