<commit_before># Unit test for libchen
# <NAME> <<EMAIL>>
# http://chensoft.com
# Licensed under MIT license
# Copyright 2016 <NAME>
cmake_minimum_required(VERSION 2.8)
project(test_libchen)

# environment
include(../cmake/ChenInit.cmake)
include(../cmake/ChenUtil.cmake)

if(UNIX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
endif()

# code coverage
option(LIBCHEN_TEST_CODE_COVERAGE "Enable libchen code coverage." OFF)

if(CMAKE_COMPILER_IS_GNUCXX AND LIBCHEN_TEST_CODE_COVERAGE)
    message("-- Enable code coverage")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage")  # debug, no optimisation, enabling coverage
endif()

# libraries
set(gtest_force_shared_crt ON CACHE BOOL "Use /MD in googletest")

add_subdirectory(.. libchen)
add_subdirectory(lib/googletest/googletest)

# include path
include_directories(../include)
include_directories(lib/googletest/googletest/include)

# source codes
file(GLOB INC_ROOT *.hpp)
file(GLOB SRC_ROOT *.CPP)
file(GLOB_RECURSE SRC_TEST src/*.cpp)

set(INC_TEST ${INC_ROOT})
set(SRC_TEST ${SRC_ROOT} ${SRC_TEST})

# generate app
add_executable(test_libchen ${INC_TEST} ${SRC_TEST})

# link library
target_link_libraries(test_libchen libchen gtest)

# group files in the IDE(e.g: Xcode and Visual Studio)
chen_group_files(${CMAKE_CURRENT_SOURCE_DIR} "${INC_TEST}")
chen_group_files(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_TEST}")<commit_msg>cmake: fix spell error<commit_after># Unit test for libchen
# <NAME> <<EMAIL>>
# http://chensoft.<EMAIL>
# Licensed under MIT license
# Copyright 2016 <NAME>
cmake_minimum_required(VERSION 2.8)
project(test_libchen)

# environment
include(../cmake/ChenInit.cmake)
include(../cmake/ChenUtil.cmake)

if(UNIX)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
endif()

# code coverage
option(LIBCHEN_TEST_CODE_COVERAGE "Enable libchen code coverage." OFF)

if(CMAKE_COMPILER_IS_GNUCXX AND LIBCHEN_TEST_CODE_COVERAGE)
    message("-- Enable code coverage")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage")  # debug, no optimisation, enabling coverage
endif()

# libraries
set(gtest_force_shared_crt ON CACHE BOOL "Use /MD in googletest")

add_subdirectory(.. libchen)
add_subdirectory(lib/googletest/googletest)

# include path
include_directories(../include)
include_directories(lib/googletest/googletest/include)

# source codes
file(GLOB INC_ROOT *.hpp)
file(GLOB SRC_ROOT *.cpp)
file(GLOB_RECURSE SRC_TEST src/*.cpp)

set(INC_TEST ${INC_ROOT})
set(SRC_TEST ${SRC_ROOT} ${SRC_TEST})

# generate app
add_executable(test_libchen ${INC_TEST} ${SRC_TEST})

# link library
target_link_libraries(test_libchen libchen gtest)

# group files in the IDE(e.g: Xcode and Visual Studio)
chen_group_files(${CMAKE_CURRENT_SOURCE_DIR} "${INC_TEST}")
chen_group_files(${CMAKE_CURRENT_SOURCE_DIR} "${SRC_TEST}")
{'fraction_non_alphanumeric': 0.12325025606008877, 'fraction_numerical': 0.004779788323659952, 'mean_word_length': 6.512820512820513, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '4291166', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1055, 'n_words': 222}