Motion: add initial test infrastructure and stubs
parent
18ced44341
commit
4fd22f0656
|
|
@ -3,3 +3,4 @@ add_subdirectory(leds)
|
||||||
add_subdirectory(protocol)
|
add_subdirectory(protocol)
|
||||||
add_subdirectory(speed_table)
|
add_subdirectory(speed_table)
|
||||||
add_subdirectory(pulse_gen)
|
add_subdirectory(pulse_gen)
|
||||||
|
add_subdirectory(motion)
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include "catch2/catch.hpp"
|
||||||
|
#include "motion.h"
|
||||||
|
|
||||||
|
using modules::motion::motion;
|
||||||
|
|
||||||
|
TEST_CASE("motion::basic", "[motion]") {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,11 @@ namespace tmc2130 {
|
||||||
TMC2130::TMC2130(const MotorParams ¶ms,
|
TMC2130::TMC2130(const MotorParams ¶ms,
|
||||||
const MotorCurrents ¤ts,
|
const MotorCurrents ¤ts,
|
||||||
MotorMode mode) {
|
MotorMode mode) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void TMC2130::SetMode(MotorMode mode) {
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace tmc2130
|
} // namespace tmc2130
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue