From f7f0ba4206bfc30d4f9727a0e2448ee43cba6aad Mon Sep 17 00:00:00 2001 From: gcontini <1121667+gcontini@users.noreply.github.com> Date: 周二, 17 11月 2020 10:19:54 +0800 Subject: [PATCH] fix mingw --- test/library/os/CMakeLists.txt | 27 +++++++++++++++------------ test/library/os/dmi_info_test.cpp | 8 +++----- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/test/library/os/CMakeLists.txt b/test/library/os/CMakeLists.txt index e91e417..64d64b4 100644 --- a/test/library/os/CMakeLists.txt +++ b/test/library/os/CMakeLists.txt @@ -11,19 +11,19 @@ ADD_TEST(NAME test_network COMMAND test_network) -add_executable( test_dmi_info dmi_info_test.cpp "dmi_info_test.cpp") - -target_link_libraries( test_dmi_info - licensecc_static - Boost::unit_test_framework - Boost::filesystem - Boost::system -) - -ADD_TEST(NAME test_dmi_info COMMAND test_dmi_info) +IF(NOT DEFINED MINGW) + add_executable( test_dmi_info dmi_info_test.cpp "dmi_info_test.cpp") + target_link_libraries( test_dmi_info + licensecc_static + Boost::unit_test_framework + Boost::filesystem + Boost::system + ) + ADD_TEST(NAME test_dmi_info COMMAND test_dmi_info) +ENDIF(NOT DEFINED MINGW) add_executable( test_execution_environment - execution_environment_test.cpp + execution_environment_test.cpp ) target_link_libraries( test_execution_environment @@ -36,7 +36,10 @@ ADD_TEST(NAME test_execution_environment COMMAND test_execution_environment) if(CODE_COVERAGE AND UNIX) - target_compile_options(test_dmi_info PUBLIC -O0 -g --coverage) + IF(NOT DEFINED MINGW) + target_compile_options(test_dmi_info PUBLIC -O0 -g --coverage) + ENDIF(NOT DEFINED MINGW) + target_compile_options(test_execution_environment PUBLIC -O0 -g --coverage) target_compile_options(test_network PUBLIC -O0 -g --coverage) endif(CODE_COVERAGE AND UNIX) diff --git a/test/library/os/dmi_info_test.cpp b/test/library/os/dmi_info_test.cpp index 5f44d62..2e079c9 100644 --- a/test/library/os/dmi_info_test.cpp +++ b/test/library/os/dmi_info_test.cpp @@ -5,7 +5,6 @@ #include <boost/test/unit_test.hpp> #include "../../../src/library/os/dmi_info.hpp" - namespace license { namespace test { using namespace std; @@ -13,10 +12,9 @@ BOOST_AUTO_TEST_CASE(dmi_info) { os::DmiInfo dmiInfo; - BOOST_CHECK_MESSAGE(dmiInfo.bios_vendor().size()>0, "Bios vendor OK"); - BOOST_CHECK_MESSAGE(dmiInfo.bios_description().size() > 0, "Bios description OK"); - BOOST_CHECK_MESSAGE(dmiInfo.sys_vendor().size() > 0, "Sys vendor OK"); - + BOOST_CHECK_MESSAGE(dmiInfo.bios_vendor().size() > 0, "Bios vendor length >0"); + BOOST_CHECK_MESSAGE(dmiInfo.bios_description().size() > 0, "Bios description length >0"); + BOOST_CHECK_MESSAGE(dmiInfo.sys_vendor().size() > 0, "Sys vendor length >0"); } } // namespace test -- Gitblit v1.9.1