mirror of https://github.com/polybar/polybar.git
tests: Use local gtest headers
This makes sure the headers and the compiled gtest library are compatible
This commit is contained in:
parent
fa99be63a0
commit
0e5584920b
|
@ -65,7 +65,6 @@ addons:
|
|||
- python-xcbgen
|
||||
- xcb-proto
|
||||
- xutils-dev
|
||||
- libgtest-dev
|
||||
|
||||
cache:
|
||||
directories:
|
||||
|
|
|
@ -28,7 +28,7 @@ if(result)
|
|||
endif()
|
||||
|
||||
# Add googletest directly to our build. This defines
|
||||
# the gtest and gtest_main targets.
|
||||
# the gtest, gtest_main, gmock and gmock_main targets.
|
||||
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
|
||||
${CMAKE_BINARY_DIR}/googletest-build
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
@ -51,8 +51,8 @@ function(unit_test file tests)
|
|||
set(name "unit_test.${testname}")
|
||||
add_executable(${name} unit_tests/${file}.cpp ${sources})
|
||||
|
||||
# Link against googletest
|
||||
target_link_libraries(${name} gtest_main)
|
||||
# Link against gmock (this automatically links against gtest)
|
||||
target_link_libraries(${name} gmock_main)
|
||||
|
||||
add_test(NAME ${name} COMMAND ${name})
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
#define expect(...) \
|
||||
(void)((__VA_ARGS__) || (expect_fail__(#__VA_ARGS__, __FILE__, __LINE__), 0))
|
||||
|
|
Loading…
Reference in New Issue