robotology / blocktest

Test system for generic robot middlewares
GNU Lesser General Public License v3.0
8 stars 2 forks source link

IWYU: Add thread include in dataLogger.h #56

Closed traversaro closed 2 years ago

traversaro commented 2 years ago

The dataLogger.h file was using classes like std::thread, but the thread header was never included. This PR fixes this problem by adding the necessary include.

Without this fix, the compilation on Ubuntu 22.04 is failing with error:

2022-01-19T08:11:24.2185110Z /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -Dblocktestcore_EXPORTS -I/__w/robotology-superbuild/robotology-superbuild/build/src/blocktestcore/src/blocktestcore/blocktestcore_autogen/include -I/__w/robotology-superbuild/robotology-superbuild/src/blocktestcore/src/blocktestcore -I/__w/robotology-superbuild/robotology-superbuild/src/blocktestcore/extern/pugixml -Wall -Wextra -g -fPIC -std=gnu++17 -MD -MT src/blocktestcore/CMakeFiles/blocktestcore.dir/dataLogger.cpp.o -MF src/blocktestcore/CMakeFiles/blocktestcore.dir/dataLogger.cpp.o.d -o src/blocktestcore/CMakeFiles/blocktestcore.dir/dataLogger.cpp.o -c /__w/robotology-superbuild/robotology-superbuild/src/blocktestcore/src/blocktestcore/dataLogger.cpp
2022-01-19T08:11:24.2186844Z /__w/robotology-superbuild/robotology-superbuild/src/blocktestcore/src/blocktestcore/dataLogger.cpp: In member function 'void BlockTestCore::DataLogger::work()':
2022-01-19T08:11:24.2188009Z /__w/robotology-superbuild/robotology-superbuild/src/blocktestcore/src/blocktestcore/dataLogger.cpp:68:27: error: 'sleep_for' is not a member of 'std::this_thread'
2022-01-19T08:11:24.2189670Z    68 |         std::this_thread::sleep_for(std::chrono::milliseconds(sleepTimeMsec_));
2022-01-19T08:11:24.2189958Z       |                           ^~~~~~~~~

See https://github.com/robotology/robotology-superbuild/pull/998#issuecomment-1016190486 .

Nicogene commented 2 years ago

Merged, thanks!

traversaro commented 2 years ago

@Nicogene Unless you plant to have developement on blocktest, perhaps we could do a release now, otherwise we risk of forgetting this and getting a CI failure as soon as we create a new distro release.

triccyx commented 2 years ago

It is possible that new developments will be scheduled for March/April due to the connection of blocktest to Simulink for Hardware in the loop (HiL) activity. I think that this is a good time to schedule the new release, before new activities on HiL. @Nicogene @traversaro

Nicogene commented 2 years ago

Here is the release https://github.com/robotology/blocktest/releases/tag/v2.3.4