Import LinuxCNC source tree
This commit is contained in:
3
tests/remap/fail/body-py/README
Normal file
3
tests/remap/fail/body-py/README
Normal file
@@ -0,0 +1,3 @@
|
||||
Exercise failed remap NGC procedure
|
||||
|
||||
must properly return to top level, convey error text
|
||||
11
tests/remap/fail/body-py/expected
Normal file
11
tests/remap/fail/body-py/expected
Normal file
@@ -0,0 +1,11 @@
|
||||
executing
|
||||
1 N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
|
||||
2 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
3 N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
4 N..... SET_XY_ROTATION(0.0000)
|
||||
5 N..... SET_FEED_REFERENCE(CANON_XYZ)
|
||||
6 N..... ON_RESET()
|
||||
7 N..... MESSAGE(" before M400: call_level= 0.000000 remap_level=0.000000")
|
||||
A failed Python remap handler returning INTERP_ERROR
|
||||
O <interp_error> call
|
||||
8 N..... ON_RESET()
|
||||
24
tests/remap/fail/body-py/remap.py
Normal file
24
tests/remap/fail/body-py/remap.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# This is a component of LinuxCNC
|
||||
# Copyright 2011 Michael Haberler <git@mah.priv.at>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
import interpreter
|
||||
|
||||
def interp_error(self, **words):
|
||||
self.set_errormsg("A failed Python remap handler returning INTERP_ERROR")
|
||||
return interpreter.INTERP_ERROR
|
||||
|
||||
|
||||
21
tests/remap/fail/body-py/subs.py
Normal file
21
tests/remap/fail/body-py/subs.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# This is a component of LinuxCNC
|
||||
# Copyright 2011 Michael Haberler <git@mah.priv.at>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
import remap
|
||||
|
||||
|
||||
|
||||
13
tests/remap/fail/body-py/test.ini
Normal file
13
tests/remap/fail/body-py/test.ini
Normal file
@@ -0,0 +1,13 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[PYTHON]
|
||||
PATH_PREPEND=.
|
||||
TOPLEVEL=subs.py
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
REMAP=M400 modalgroup=5 py=interp_error
|
||||
|
||||
LOG_LEVEL=0
|
||||
4
tests/remap/fail/body-py/test.ngc
Normal file
4
tests/remap/fail/body-py/test.ngc
Normal file
@@ -0,0 +1,4 @@
|
||||
(debug, before M400: call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
M400
|
||||
(debug, after failed M400: call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
M2
|
||||
3
tests/remap/fail/body-py/test.sh
Executable file
3
tests/remap/fail/body-py/test.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
export PYTHONUNBUFFERED=1
|
||||
! rs274 -i test.ini -n 2 -g test.ngc 2>&1
|
||||
Reference in New Issue
Block a user