From b5dc8e7a352f93d3190c6a2d0ad6592c878bfc7d Mon Sep 17 00:00:00 2001 From: Yanyi Wu Date: Fri, 2 May 2025 21:28:28 +0800 Subject: [PATCH] build: update .gitignore and CMakeLists for test configuration - Added entries to .gitignore for temporary test files. - Included a message to display MSVC value during build. - Added UTF-8 compile option for MSVC in unittest CMakeLists. --- .gitignore | 2 ++ CMakeLists.txt | 1 + test/unittest/CMakeLists.txt | 1 + 3 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 15fd2b8..4a1921d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ tmp t.* *.pid build +Testing/Temporary/CTestCostData.txt +Testing/Temporary/LastTest.log diff --git a/CMakeLists.txt b/CMakeLists.txt index 0922f31..253cda1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ option(CPPJIEBA_BUILD_TESTS "Build cppjieba tests" ${CPPJIEBA_TOP_LEVEL_PROJECT} if(CPPJIEBA_BUILD_TESTS) ENABLE_TESTING() + message(STATUS "MSVC value: ${MSVC}") ADD_SUBDIRECTORY(test) if(NOT MSVC) ADD_TEST(NAME ./test/test.run COMMAND ./test/test.run) diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt index 053823e..9871638 100644 --- a/test/unittest/CMakeLists.txt +++ b/test/unittest/CMakeLists.txt @@ -1,6 +1,7 @@ if (MSVC) set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebugDLL") set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + add_compile_options(/utf-8) endif() include(FetchContent)