Commit graph

622 commits

Author SHA1 Message Date
Sebastian Kuzminsky
9e2a8e2078 tests: add a test of stat.queued_mdi_commands
This test verifies that stat->task.queuedMDIcommands (aka
stat.queued_mdi_command in python-land) grows as we add MDI commands to
Task's MDI queue and shrinks as Task executes them.

This test currently fails because queuedMDIcommands is always 0.  I fix
Task in the following commit to set it correctly.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2017-02-10 15:02:14 -07:00
Chris Radek
8d493ba452 Fix bug 160: surprise motion after g41/no move/g40
Signed-off-by: Chris Radek <chris@timeguy.com>
2016-10-21 13:58:50 -05:00
Sebastian Kuzminsky
e3c6812fe4 Merge remote-tracking branch 'origin/2.6' into 2.7 2016-10-20 13:37:48 -05:00
Sebastian Kuzminsky
b36c723745 tests: enable the abort-vs-feed-rate test created a few commits ago
It's fixed now, so let's make sure we don't break it again.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-10-20 13:34:27 -05:00
Sebastian Kuzminsky
b58bd9f2d4 tests: add an abort-vs-feed-rate test (skipped)
This test verifies that the "active g-codes" F-word is correct after
a synch (eg, after an Abort or after a switch into and back out of
Manual mode).  It replicates github Issue #180, reported by @fixerslo.

The test is marked "skip" for now, i'll remove the skip marker after I
fix it in the next few commits.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-10-20 12:59:18 -05:00
Sebastian Kuzminsky
22a053e774 Merge remote-tracking branch 'origin/2.6' into 2.7 2016-10-04 11:59:35 -06:00
Sebastian Kuzminsky
2b7ba54905 motion-logger test: add an S-word test
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-10-04 10:50:13 -06:00
Chris Radek
96dec839b5 Merge branch 'mdi-while-queuebuster-waitflag' of https://github.com/zultron/machinekit into 2.7 2016-09-24 14:06:04 -05:00
Chris Radek
7294949be2 Merge branch '2.6' into 2.7 2016-09-24 14:03:32 -05:00
Chris Radek
c5fa994c24 Merge branch 'remap-dup-oword-lcnc-2.6' of https://github.com/zultron/machinekit into 2.6 2016-09-24 13:36:23 -05:00
John Morris
15dc4ca5c1 Add mdi-while-queuebuster-waitflag regression test
This test tries to hit a race condition where an MDI command is
executed when a queue buster is waiting to be restarted after
INTERP_EXEC_FINISH.

I don't know how to hit this condition reliably, and this test may not
hit the race on other systems.  On my Intel Core 2 laptop in sim mode,
it hits the race by the third iteration about 90% of the time.

Fix is to follow.

Signed-off-by: John Morris <john@zultron.com>
2016-09-21 18:46:21 -05:00
Jeff Epler
d190b9b825 Merge remote-tracking branch 'origin/2.6' into 2.7 2016-09-18 11:54:02 -05:00
John Morris
ae4d1fe5ea Add Z axis to interp/g10/g10-l1-l10 tests
CNC milling machines primarily use Z axis TLO.

Also add comments to help sort out identical sections of tests in test
diff output.

Signed-off-by: John Morris <john@zultron.com>
2016-09-15 18:37:33 -05:00
John Morris
15a4a2b43f Remove g10-l1 test, identical to g10-l1-10
Extra copy of test added in 14524afb

Signed-off-by: John Morris <john@zultron.com>
2016-09-15 18:13:58 -05:00
Jeff Epler
0316a08fc1 testsuite: specify var filename
closes #162.

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2016-09-14 07:04:58 -05:00
Sebastian Kuzminsky
3e9834b718 add a test of early exit from cutter comp
Enable cutter comp then turn it off again without a cutter comp entry
move: the next move goes to the wrong location.

This reproduces issue #160.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-09-08 22:09:30 -06:00
Sebastian Kuzminsky
ee36c63f1b Merge remote-tracking branch 'origin/2.6' into 2.7 2016-09-03 07:56:52 -06:00
Sebastian Kuzminsky
4c613c1f8c tests: fix a cut/paste error
This was accidentally using the global name of the status buffer,
instead of the local, passed in name.

It worked, but it was still wrong.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-09-03 07:56:04 -06:00
Sebastian Kuzminsky
2a2804de6d Merge remote-tracking branch 'origin/2.6' into 2.7 2016-09-02 18:03:56 -06:00
Sebastian Kuzminsky
c7e4c36a1a rs274ngc-startup test: wait for Task to start up
Before this patch, sluggish startup of Task & Interp could cause false
failures of this test.

Wait for Task to finish initializing the Stat buffer, and for Interp to
be Idle, before asserting that the RS274NGC_STARTUP_CODE ran successfully.

Verified by (temporarily) changing the tests's startup code to "G4 P15",
the wait code timed out and threw an exception.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-09-02 17:13:24 -06:00
Sebastian Kuzminsky
ccd8c0cd1f startup-state test: throw a valid exception on timeout
TimeoutException was added in Python 3.  Python 2 doesn't have anything
quite like it, so just use the catch-all general-purpose RuntimeException
instead.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-09-02 17:13:19 -06:00
John Morris
2e52efef60 Fix subs breaking when placed after main program
Remove a line mistakenly added to `control_back_to()`.  Comment item 3
was the tipoff that this used to work:

    // 3 -- skip to the o_word (will be an error if not found)

Signed-off-by: John Morris <john@zultron.com>
2016-08-22 15:58:58 -05:00
John Morris
ca7c2de299 Unit test for M30 and remapped command interaction
M30 and M02 reset interp's `remap_level`.  Combining in a block with a
remapped code triggers the error 'BUG: remap_level < 0 : -1'.

Signed-off-by: John Morris <john@zultron.com>
2016-08-22 15:46:00 -05:00
Chris Radek
df183a4a7f Merge branch '2.6' into 2.7 2016-08-19 14:45:04 -05:00
John Morris
cee63e5be3 Unit test demonstrating a remap bug
In very specific circumstances, a "duplicate O-word label" error may
be triggered in remapped codes.  See README file for details.

Signed-off-by: John Morris <john@zultron.com>
2016-08-19 13:39:58 -05:00
John Morris
d276f6c2f5 nested-remaps-oword test: Do what README says
Verify that sequence numbers are restored properly *at all levels*
after returning from remap.

In second-level and deeper remaps, a regression causes
`sequence_number` to be reset to that of the top-level file after
return from the remap.  This causes subtle bugs in rare cases, such as
one triggering the "duplicate O-word label" sanity check.

Signed-off-by: John Morris <john@zultron.com>
2016-08-19 13:39:58 -05:00
Sebastian Kuzminsky
588b186882 add a test validating the startup state of the Status buffer
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-08-19 13:35:16 -05:00
Chris Radek
61ad22ab6c Test initial coordinate system and RS274NGC_STARTUP_CODE
The RS274NGC_STARTUP_CODE is a tool offset load; the test confirms
this value is loaded from the tool table and shows up in the stat
buffer upon startup.

Signed-off-by: Chris Radek <chris@timeguy.com>
2016-08-19 13:34:09 -05:00
Chris Radek
85210a3360 Fix startup regression regarding coordinate systems and more
In b996c77 Seb correctly determined that emcTaskPlanInit() was being
called twice, and removed the second one.  However, this second call
was working around a problem where Interp::init() placed important
startup messages on the interp list, and then they were discarded by
emcTaskSetState() calling emcTaskAbort() which clears the interp list.

Since I think it's important for SetState and SetMode to still
TaskAbort in non-startup situations, I remove those calls from startup
and call directly the things startup needs.

This restores the correct behavior of the stat buffer having nonzero
g5x index and corresponding offsets at startup (and therefore AXIS's
DRO and preview are correct), and also the operation of
RS274NGC_STARTUP_CODE.

The two tests needed adjusting because task startup no longer calls
emcMotionAbort() twice.

Signed-off-by: Chris Radek <chris@timeguy.com>
2016-08-19 13:31:12 -05:00
Sebastian Kuzminsky
f016d191eb Merge remote-tracking branch 'origin/2.6' into 2.7 2016-07-29 08:54:47 -06:00
Sebastian Kuzminsky
1e809f966d skip the tests that fail without the task fixes
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-07-28 22:34:16 -06:00
Sebastian Kuzminsky
9e530d8110 Revert "interp: reset Interp and Canon state on Abort"
This reverts commit 991984ed69.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-07-28 22:34:16 -06:00
Sebastian Kuzminsky
4b9f8da298 Revert "Task: add drain_interp_list"
This reverts commit 402c27bddf.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-07-28 22:34:16 -06:00
Sebastian Kuzminsky
d4c6c1e1ae Merge remote-tracking branch 'origin/2.6' into 2.7 2016-07-27 15:47:03 -06:00
Sebastian Kuzminsky
93f791353b hard-limits test: try again to detect end-of-motion
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-07-27 14:33:29 -06:00
Sebastian Kuzminsky
afdaaddba0 hard-limits test: be robust against realtime delay warnings
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-07-27 12:03:59 -06:00
Sebastian Kuzminsky
14076546a3 Merge remote-tracking branch 'origin/2.6' into 2.7 2016-07-27 11:00:32 -06:00
Sebastian Kuzminsky
54bcbf836e test: add a hard limit test
This reproduces Issue #117.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-07-27 10:56:14 -06:00
Sebastian Kuzminsky
1bdc5742ad tests: longer timeout in halui mdi test
This should cut down on the rate of sporadic timing-caused test failures.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-18 12:43:15 -06:00
Jeff Epler
d564572aee Merge branches 'jepler/2.7/external-rs274' and 'jepler/2.7/test-hm2-idrom' into 2.7 2016-06-17 10:47:16 -05:00
Jeff Epler
70e93107d9 tests: hm2-idrom: exit early when a test fails
this way the evidence such as halrun-stderr, is still available for
post-mortem of a failure.

Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2016-06-17 10:46:03 -05:00
Jeff Epler
8712f7f62d tests: compile an example user of librs274
Signed-off-by: Jeff Epler <jepler@unpythonic.net>
2016-06-17 10:45:20 -05:00
Sebastian Kuzminsky
f281232be3 update startup-gcode-abort test for the new TP in 2.7
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-16 14:50:44 -06:00
Sebastian Kuzminsky
27bc840796 Merge remote-tracking branch 'origin/2.6' into 2.7 2016-06-16 14:15:25 -06:00
Sebastian Kuzminsky
402c27bddf Task: add drain_interp_list
drain the interp_list after Task init and Abort.

Don't clear the interp_list on Abort, if we're draining.

Fixes #49.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-11 15:37:28 -06:00
Sebastian Kuzminsky
991984ed69 interp: reset Interp and Canon state on Abort
When cleaning up after an Abort, do all the same cleanup as after M2/M30.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-11 15:37:28 -06:00
Sebastian Kuzminsky
1b7a5238c8 tests/motion-logger/basic: comment 'expected' file
This commit doesn't change any test content, it only adds comments to
try to make sense of the Motion commands generated during test startup.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-11 15:37:27 -06:00
Sebastian Kuzminsky
ba334e3039 tests/motion-logger/basic: allow comments in expected files
This augments the motion-logger/basic test to allow comments in the
'expected' files.  The 'expected' files are preprocessed to remove
comment lines and empty lines before being compared to the actual output.

The 'expected.builtin-startup' file is renamed with a '.in' extension to
trigger this kind of preprocessing.  No actual test content was changed
with this commit.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-11 15:37:10 -06:00
Sebastian Kuzminsky
16eec37a68 add a test of STARTUP_GCODE vs Abort
This demonstrates Issue #49 on Github, reported by Micges.

Fixed in the commits that follow.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-11 15:36:49 -06:00
Sebastian Kuzminsky
3b82074b23 add a test to reproduce the preview-strangeness reported by Zultron
The symptom is that after aborting a program that changes which G5x
coordinate system is active, the stat buffer still has the old g5x_index
and g5x_offsets.

The interp parameters have the correct values, it's just the stat buffer
that's affected.

Fixed in the commits that follow.

Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
2016-06-11 15:36:41 -06:00