Hi All,

I've been working on a simple unit testing framework for motion / TP based
on a Meson <https://mesonbuild.com/> build script and the "greatest
<https://github.com/silentbicycle/greatest>" framework, which can be seen
in this development branch:

https://github.com/robEllenberg/linuxcnc-mirror/tree/rellenberg/develop-combined-2.7

I chose Meson mostly as an exercise, to see if it was indeed less of a
headache than CMake. At this point I can say that the syntax is much nicer
if you know Python, and it was very quick to get a working build going.
Similarly, greatest was simple to use (include the header, paste in some
boilerplate, write test cases). With some tweaks to the macros, it does its
job well.

That said, the build script isn't complicated, so it wouldn't be much loss
to port to CMake / autotools. Similarly, the test macros are generic enough
to find / replace with a new framework if needed.

Having the unit tests has made a huge difference for me so far. Proving
that some little function buried in the TP code actually does what's
expected is much easier if I don't have to run the whole environment in sim
and launch a test program. While some code isn't really practical to test
this way (e.g. tpRunCycle), it really helps with more standalone functions
and fundamentals (like blendmath.c and spherical_arc.c).

My development branch also has other fixes and features mixed in:

   - Spindle sync performance improvements (from previous work)
   - A kludged-together TP regression test suitable for inclusion in
   runtests, which can catch some obvious violations / errors.
   - Miscellaneous fixes for acceleration violations
   - Experimental method to check for true circular motion bounds in the TP

If there's interest, I can try to isolate one or more of these changes for
inclusion in master or a future 2.7 release.

Best,
Rob

_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to