File tree Expand file tree Collapse file tree 4 files changed +22
-15
lines changed Expand file tree Collapse file tree 4 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88### Added
99- [ Issue #17 ] ( https://github.com/suikan4github/template_application/issues/17 ) : Add gcovr support.
1010### Changed
11+ - [ Issue #18 ] ( https://github.com/suikan4github/template_application/issues/18 ) : Display alll warning during build
1112### Fixed
1213
1314## [ 1.2.0] - 2022-01-02
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ file(GLOB ALL_SRCS "*.cpp")
1010
1111add_executable (${EXECUTABLE_NAME} ${ALL_SRCS} )
1212
13- # Add pthread library to support std::thread
14- # In the case of MSVC, this is not required.
15- if (NOT (MSVC ))
16- target_link_libraries (${EXECUTABLE_NAME} "pthread" )
17- endif (NOT (MSVC ))
13+ # Add pthread library to support std::thread
14+ # In the case of MSVC, this is not required.
15+ if (NOT (MSVC ))
16+ target_link_libraries (${EXECUTABLE_NAME} "pthread" )
17+ endif (NOT (MSVC ))
1818
Original file line number Diff line number Diff line change @@ -19,15 +19,22 @@ set(TEST_EXECUTABLE_NAME test_${PROJECT_NAME})
1919# Add the executable for the testcase which is using googletest
2020add_executable (${TEST_EXECUTABLE_NAME} ${TEST_SRC} ${LIB_SRC} )
2121
22- # Add the library under test.
23- target_link_libraries (${TEST_EXECUTABLE_NAME}
24- "gtest_main"
25- )
26- # Add the include directory for test executable.
27- target_include_directories (${TEST_EXECUTABLE_NAME}
28- PUBLIC
29- "${CMAKE_CURRENT_SOURCE_DIR} /../src"
22+ # Add the library under test.
23+ target_link_libraries (${TEST_EXECUTABLE_NAME}
24+ "gtest_main"
3025 )
26+ # Add the include directory for test executable.
27+ target_include_directories (${TEST_EXECUTABLE_NAME}
28+ PUBLIC
29+ "${CMAKE_CURRENT_SOURCE_DIR} /../src"
30+ )
31+ if (MSVC )
32+ target_compile_options (${TEST_EXECUTABLE_NAME} PRIVATE /W4 )
33+ else ()
34+ target_compile_options (${TEST_EXECUTABLE_NAME} PRIVATE -Wall -Wextra -pedantic )
35+ endif ()
36+
37+
3138
3239# Find and integrate the Google Test package
3340
Original file line number Diff line number Diff line change 77// Read GoogleTest document https://github.com/google/googletest/blob/main/docs/advanced.md#death-test-naming
88TEST (CalcDeathTest, SqrtWithMinusParam)
99{
10- Calc calc;
11-
1210#ifndef NDEBUG
11+ Calc calc;
1312 // We test only when assert() works.
1413 ASSERT_DEATH (calc.sqrt (-1 ), " param >= 0" );
1514#endif
You can’t perform that action at this time.
0 commit comments