Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Unittest on Windows #830

Merged
merged 16 commits into from
Sep 27, 2022
Merged
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);
}