Skip to content

Commit eceb189

Browse files
authored
[PTI-LIB] Fix Small Build Issues (#469)
* Ensure `pti_assert_test` gets enumerated and works on Windows. * Fix build error with custom build types. * Add wbr to sdk `.gitignore`. Signed-off-by: Schilling, Matthew <[email protected]>
1 parent 31dd087 commit eceb189

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

sdk/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ venv/
88
compile_commands.json
99
CMakeUserPresets.json
1010
error_diff.txt
11+
wbr

sdk/cmake/Modules/FindXpti.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ if(Xpti_FOUND AND NOT TARGET Xpti::xpti)
161161
TARGET Xpti::xpti
162162
APPEND
163163
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
164-
set_target_properties(Xpti::xpti PROPERTIES IMPORTED_IMPLIB_RELEASE
164+
set_target_properties(Xpti::xpti PROPERTIES IMPORTED_IMPLIB
165+
"${Xpti_Shared_LIBRARY}"
166+
IMPORTED_IMPLIB_RELEASE
165167
"${Xpti_Shared_LIBRARY}")
166168
if(Xpti_Shared_Runtime_LIBRARY)
167169
set_target_properties(
@@ -203,7 +205,8 @@ if(Xpti_FOUND AND NOT TARGET Xpti::xpti_static)
203205
PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
204206
set_target_properties(
205207
Xpti::xpti_static
206-
PROPERTIES IMPORTED_IMPLIB_RELEASE "${Xpti_Static_LIBRARY}"
208+
PROPERTIES IMPORTED_IMPLIB "${Xpti_Static_LIBRARY}"
209+
IMPORTED_IMPLIB_RELEASE "${Xpti_Static_LIBRARY}"
207210
IMPORTED_LOCATION "${Xpti_Static_LIBRARY}"
208211
IMPORTED_LOCATION_RELEASE "${Xpti_Static_LIBRARY}")
209212
endif()

sdk/test/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,11 @@ add_executable(pti_assert_test pti_assert_test.cc)
434434
target_include_directories(pti_assert_test PUBLIC
435435
"${PROJECT_SOURCE_DIR}/src/utils")
436436

437-
target_link_libraries(pti_assert_test PUBLIC GTest::gtest_main)
437+
target_link_libraries(pti_assert_test PUBLIC GTest::gtest_main GTest::gmock)
438+
439+
gtest_discover_tests(
440+
pti_assert_test
441+
PROPERTIES LABELS "unit")
438442

439443
gtest_discover_tests(
440444
view_record_test

sdk/test/pti_assert_test.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "pti_assert.h"
22

3+
#include <gmock/gmock.h>
34
#include <gtest/gtest.h>
45

56
TEST(PtiAssertTest, CheckCorrectAssertion) {
@@ -13,6 +14,8 @@ TEST(PtiAssertTest, CheckIncorrectAssertion) {
1314
const int value_1 = 0;
1415
const int value_2 = 1;
1516
EXPECT_NE(value_1, value_2);
16-
EXPECT_DEATH_IF_SUPPORTED(PTI_ASSERT(value_1 == value_2), __FILE__ ":");
17+
// clang-format off
18+
EXPECT_DEATH_IF_SUPPORTED(PTI_ASSERT(value_1 == value_2), ::testing::HasSubstr(__FILE__ ":"));
19+
// clang-format on
1720
PTI_ASSERT(value_1 != value_2);
1821
}

0 commit comments

Comments
 (0)