diff --git a/src/modules/motion.cpp b/src/modules/motion.cpp index ef62a74..edc6e79 100644 --- a/src/modules/motion.cpp +++ b/src/modules/motion.cpp @@ -62,10 +62,6 @@ bool Motion::QueueEmpty() const { return true; } -bool Motion::QueueEmpty(config::Axis axis) const { - return axisData[axis].ctrl.QueueEmpty(); -} - void Motion::AbortPlannedMoves(bool halt) { for (uint8_t i = 0; i != NUM_AXIS; ++i) axisData[i].ctrl.AbortPlannedMoves(halt); diff --git a/src/modules/motion.h b/src/modules/motion.h index 783226b..472b9b7 100644 --- a/src/modules/motion.h +++ b/src/modules/motion.h @@ -239,7 +239,14 @@ public: /// @returns true if all planned moves have been finished for one axis /// @param axis requested - bool QueueEmpty(Axis axis) const; + bool QueueEmpty(Axis axis) const +#ifndef UNITTEST + { + return axisData[axis].ctrl.QueueEmpty(); + } +#else + ; +#endif /// @returns false if new moves can still be planned for one axis /// @param axis axis requested diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 53fd3a5..51c5944 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -1,6 +1,8 @@ # first, let's create a symbolic target for all tests add_custom_target(tests) +add_compile_definitions(UNITTEST) + # include catch_discover_tests function from Catch2 include(${Catch2_SOURCE_DIR}/contrib/Catch.cmake)