Skip to content

Commit

Permalink
Fix for Unittest on Windows (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
triccyx authored Sep 27, 2022
1 parent 7c612ff commit 2b30831
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ jobs:
-DENABLE_icubmod_embObjMultipleFTsensors:BOOL=ON \
-DENABLE_icubmod_parametricCalibrator:BOOL=ON \
-DENABLE_icubmod_parametricCalibratorEth:BOOL=ON \
-DBUILD_TESTING:BOOL=ON \
-DICUB_SHARED_LIBRARY=OFF \
-DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install ..
- name: Configure [Ubuntu/macOS]
Expand Down Expand Up @@ -206,10 +208,12 @@ jobs:
shell: bash
run: |
cd build
export PATH=$PATH:${GITHUB_WORKSPACE}/install/lib/yarp:${GITHUB_WORKSPACE}/install/bin:${GITHUB_WORKSPACE}/install
ctest run_unit_test --output-on-failure -C ${{ matrix.build_type }} .
- name: Install
shell: bash
run: |
cd build
export PATH=$PATH:${GITHUB_WORKSPACE}/install/lib/yarp:${GITHUB_WORKSPACE}/install/bin:${GITHUB_WORKSPACE}/install
cmake --build . --config ${{ matrix.build_type }} --target install
2 changes: 1 addition & 1 deletion src/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
#include(GoogleTest)
#gtest_discover_tests(${PROJECT_NAME})
gtest_add_tests(TARGET ${PROJECT_NAME} TEST_PREFIX old:)
gtest_discover_tests(${PROJECT_NAME} TEST_PREFIX new:)
gtest_discover_tests(${PROJECT_NAME} TEST_PREFIX new: PROPERTIES TIMEOUT 600)
add_test(NAME monolithic COMMAND ${PROJECT_NAME})

#add_custom_target(run_unit_test ALL
Expand Down
2 changes: 1 addition & 1 deletion src/unittest/testDeviceMultipleFTSensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,5 +339,5 @@ TEST(MultiplembObjMultipleFTsensor, calculateBoardTime_positive_001)
double second = device.calculateBoardTime(2000000);
double diff = second - first;

EXPECT_TRUE(1.0 == diff);
EXPECT_DOUBLE_EQ(1.0,diff);
}

0 comments on commit 2b30831

Please sign in to comment.