diff --git a/tests/unit/modules/CMakeLists.txt b/tests/unit/modules/CMakeLists.txt index 6467464..3dfd031 100644 --- a/tests/unit/modules/CMakeLists.txt +++ b/tests/unit/modules/CMakeLists.txt @@ -3,3 +3,4 @@ add_subdirectory(leds) add_subdirectory(protocol) add_subdirectory(speed_table) add_subdirectory(pulse_gen) +add_subdirectory(motion) diff --git a/tests/unit/modules/motion/CMakeLists.txt b/tests/unit/modules/motion/CMakeLists.txt new file mode 100644 index 0000000..626a338 --- /dev/null +++ b/tests/unit/modules/motion/CMakeLists.txt @@ -0,0 +1,19 @@ +# define the test executable +add_executable( + motion_tests + ${CMAKE_SOURCE_DIR}/src/modules/motion.cpp + ${CMAKE_SOURCE_DIR}/src/modules/speed_table.cpp + ${CMAKE_SOURCE_DIR}/src/modules/pulse_gen.cpp + ${MODULES_STUBS_DIR}/stub_gpio.cpp + ${MODULES_STUBS_DIR}/stub_shr16.cpp + ${MODULES_STUBS_DIR}/stub_tmc2130.cpp + test_motion.cpp + ) + +# define required search paths +target_include_directories( + motion_tests PUBLIC ${CMAKE_SOURCE_DIR}/src/modules ${CMAKE_SOURCE_DIR}/src/hal + ) + +# tell build system about the test case +add_catch_test(motion_tests) diff --git a/tests/unit/modules/motion/test_motion.cpp b/tests/unit/modules/motion/test_motion.cpp new file mode 100644 index 0000000..f6def34 --- /dev/null +++ b/tests/unit/modules/motion/test_motion.cpp @@ -0,0 +1,8 @@ +#include "catch2/catch.hpp" +#include "motion.h" + +using modules::motion::motion; + +TEST_CASE("motion::basic", "[motion]") { + // TODO +} diff --git a/tests/unit/modules/stubs/stub_tmc2130.cpp b/tests/unit/modules/stubs/stub_tmc2130.cpp index 7ab2e00..0182c69 100644 --- a/tests/unit/modules/stubs/stub_tmc2130.cpp +++ b/tests/unit/modules/stubs/stub_tmc2130.cpp @@ -6,6 +6,11 @@ namespace tmc2130 { TMC2130::TMC2130(const MotorParams ¶ms, const MotorCurrents ¤ts, MotorMode mode) { + // TODO +} + +void TMC2130::SetMode(MotorMode mode) { + // TODO } } // namespace tmc2130