Commit graph

25 commits

Author SHA1 Message Date
Robert W. Ellenberg
666720451b test: Fix g84 spindle direction check and runtests
G84 runtests were failing locally because the spindle was not started in
the test NGC files, and an invalid spindle state (i.e. not stopped, CW or
CCW) was ignored in the interp.
2019-07-03 10:23:26 -04:00
Robert W. Ellenberg
80d52da04f unit_test: Convert a bunch of REQUIRE's to CHECK for log clarity
Aome failures are easier to diagnose when all asserts are tested in a
block (e.g. rotations).
2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
19b17f6086 unit_test: add a unit test for G10 L20 on an active work offset 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
8e93be8ef4 unit_test: replace some specialized interp testing macros with catch Matcher backend 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
a006d52a03 catch: crudely compact the console reporter to produce more GCC-friendly failure messages for QtCreator
NOTE: this is purely cosmetic and can be reverted in the future if necessary.
2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
301a53d2e8 Update to catch2 2.7.2 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
0f6f3688e3 unit_test: parse tests for G0 and G2 moves 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
b90dc99c65 unit_test: Add simple case for parsing G-code (linear move command) 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
1f0eaa3e86 unit_test: Make G10 L2 unit tests easier to follow (include math instead of magic numbers) 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
aa21a53324 unit_test: check axis offset unit conversion 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
da0a074b23 unit_test: Prevent test_interp cross contamination via saicanon globals 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
3269713a05 unit_test: add convert_length_units test cases to ensure that current position and work offsets are converted as expected. 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
ff22f0dc14 unit_test: check save / restore of G92 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
035d1795bc unit_test: Add test cases for a subset of the g10-with-g92 runtest 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
fbf9cf8688 unit_test: Fix unit tests after saicanon changes
The "mock" file just had a few globals that would be clearer to just
store in the main test file.
2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
5802197453 Try doing sections in test cases instead of individual tests 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
1b8d53a25e Redirect unit test canon output to a log file (not currently used for tests results) 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
c112ab3e0c unit_test: Move some interp test helpers to a separate header for easier reuse. 2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
26d4ae0055 catch: crudely compact the console reporter to produce more GCC-friendly failure messages for QtCreator
NOTE: this is purely cosmetic and can be reverted in the future if necessary.
2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
85909962a3 unit_test: Add basic interp unit tests and refactor for faster compile
Unit tests for interp are now broken up into:
* tests_main.cc, which defines some common resources and the main function.
* test_interp_basics.cc, which has the initial batch of unit tests

It's trivial to add more test_XXX files as needed to cover more interp
test cases.
2019-06-28 12:15:29 -04:00
Robert W. Ellenberg
0efb95c464 unit_test: add hello world interp unit test and better meson build infrastructure
The meson build system is expanded a bit:
* meson.build files in subdirectories list files / include directories
(relative to that subdir) for later use. These build files should NOT
include any dependencies (so they can be included in any order)
* top-level meson.build specifies everything else (deps, libraries,
targets, etc.) after including the subdir files
* Some kludgy mock files are used to pave over stray missing symbols not
really needed for unit tests

The meson build could eventually be expanded to replace the existing autotools / make build if
desired (there are guides on how to do this), or scrapped and replaced
with CMake 3 if need be.
2019-06-28 12:06:34 -04:00
Robert W. Ellenberg
6e55ededc5 unit_test: add catch.hpp for Catch2 C++ unit testing 2019-06-28 12:06:34 -04:00
Robert W. Ellenberg
68d39839cb interp: Remove unnecessary link dependency of python plugin on interp lib
The strstore function is just a means to make sure that a const char *
is not deleted prematurely (it also does some caching to avoid creating
duplicate strings).

Having a separate set of strings between pyplugin and librs274 may
increase memory used slightly (since strings will no longer be shared).
2019-06-28 11:06:47 -04:00
Robert W. Ellenberg
fd4c5dd12b blendmath: implement unit tests for new parallel / anti-parallel check functions
Uses a simple meson build file to hackily build and run the unit test
executable. Eventually, the shortcuts taken in the build file could be
fixed up (i.e. with proper object file dependencies, build flags, etc.)
2019-01-22 23:12:12 -05:00
Robert W. Ellenberg
edb3525a9c Add greatest unit test framework (C, header-only macro-based unit tests) 2019-01-22 23:12:12 -05:00