Import LinuxCNC source tree
This commit is contained in:
1
tests/remap/fail/args.0/README
Normal file
1
tests/remap/fail/args.0/README
Normal file
@@ -0,0 +1 @@
|
||||
Exercise parameter passing to user-defined code
|
||||
17
tests/remap/fail/args.0/expected
Normal file
17
tests/remap/fail/args.0/expected
Normal file
@@ -0,0 +1,17 @@
|
||||
N..... USE_LENGTH_UNITS(CANON_UNITS_MM)
|
||||
N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_G92_OFFSET(0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_XY_ROTATION(0.0000)
|
||||
N..... SET_FEED_REFERENCE(CANON_XYZ)
|
||||
N..... ON_RESET()
|
||||
N..... MESSAGE(" M400 call_level= 1.000000 remap_level=1.000000")
|
||||
N..... MESSAGE(" P word set: 47.110000")
|
||||
N..... MESSAGE(" Q word set: 8.150000")
|
||||
N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
N..... SET_XY_ROTATION(0.0000)
|
||||
N..... SET_FEED_MODE(0, 0)
|
||||
N..... SET_FEED_RATE(0.0000)
|
||||
N..... STOP_SPINDLE_TURNING(0)
|
||||
N..... SET_SPINDLE_MODE(0 0.0000)
|
||||
N..... PROGRAM_END()
|
||||
N..... ON_RESET()
|
||||
18
tests/remap/fail/args.0/rm400.ngc
Normal file
18
tests/remap/fail/args.0/rm400.ngc
Normal file
@@ -0,0 +1,18 @@
|
||||
o<rm400> sub
|
||||
(debug, M400 call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
|
||||
o100 if [EXISTS[#<P>]]
|
||||
(debug, P word set: #<P>)
|
||||
o100 else
|
||||
(debug, P word missing)
|
||||
o100 endif
|
||||
|
||||
o120 if [EXISTS[#<Q>]]
|
||||
(debug, Q word set: #<Q>)
|
||||
o120 else
|
||||
(debug, Q word missing)
|
||||
o120 endif
|
||||
|
||||
o<rm400> endsub
|
||||
m2
|
||||
%
|
||||
9
tests/remap/fail/args.0/test.ini
Normal file
9
tests/remap/fail/args.0/test.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
SUBROUTINE_PATH = .
|
||||
|
||||
# M405 requires P- Q- and does NOT permit any other words in this block
|
||||
REMAP=M400 modalgroup=5 argspec=PQ ngc=rm400
|
||||
2
tests/remap/fail/args.0/test.ngc
Normal file
2
tests/remap/fail/args.0/test.ngc
Normal file
@@ -0,0 +1,2 @@
|
||||
M400 P47.11 Q8.15
|
||||
M2
|
||||
3
tests/remap/fail/args.0/test.sh
Executable file
3
tests/remap/fail/args.0/test.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
rs274 -i test.ini -g test.ngc | awk '{$1=""; print}'
|
||||
exit "${PIPESTATUS[0]}"
|
||||
3
tests/remap/fail/args.1/README
Normal file
3
tests/remap/fail/args.1/README
Normal file
@@ -0,0 +1,3 @@
|
||||
Exercise failed parameter passing to user-defined code
|
||||
|
||||
The required Q parameter is missing
|
||||
17
tests/remap/fail/args.1/expected
Normal file
17
tests/remap/fail/args.1/expected
Normal file
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
user-defined M400: missing: Q
|
||||
O <rm400> call
|
||||
7 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
8 N..... SET_XY_ROTATION(0.0000)
|
||||
9 N..... SET_FEED_MODE(0, 0)
|
||||
10 N..... SET_FEED_RATE(0.0000)
|
||||
11 N..... STOP_SPINDLE_TURNING(0)
|
||||
12 N..... SET_SPINDLE_MODE(0 0.0000)
|
||||
13 N..... PROGRAM_END()
|
||||
14 N..... ON_RESET()
|
||||
18
tests/remap/fail/args.1/rm400.ngc
Normal file
18
tests/remap/fail/args.1/rm400.ngc
Normal file
@@ -0,0 +1,18 @@
|
||||
o<rm400> sub
|
||||
(debug, M400 call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
|
||||
o100 if [EXISTS[#<P>]]
|
||||
(debug, P word set: #<P>)
|
||||
o100 else
|
||||
(debug, P word missing)
|
||||
o100 endif
|
||||
|
||||
o120 if [EXISTS[#<Q>]]
|
||||
(debug, Q word set: #<Q>)
|
||||
o120 else
|
||||
(debug, Q word missing)
|
||||
o120 endif
|
||||
|
||||
o<rm400> endsub
|
||||
m2
|
||||
%
|
||||
9
tests/remap/fail/args.1/test.ini
Normal file
9
tests/remap/fail/args.1/test.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
SUBROUTINE_PATH = .
|
||||
|
||||
# M405 requires P- Q- and does NOT permit any other words in this block
|
||||
REMAP=M400 modalgroup=5 argspec=PQ ngc=rm400
|
||||
2
tests/remap/fail/args.1/test.ngc
Normal file
2
tests/remap/fail/args.1/test.ngc
Normal file
@@ -0,0 +1,2 @@
|
||||
M400 P47.11
|
||||
M2
|
||||
3
tests/remap/fail/args.1/test.sh
Executable file
3
tests/remap/fail/args.1/test.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
rs274 -i test.ini -n 0 -g test.ngc 2>&1
|
||||
exit "${PIPESTATUS[0]}"
|
||||
3
tests/remap/fail/args.2/README
Normal file
3
tests/remap/fail/args.2/README
Normal file
@@ -0,0 +1,3 @@
|
||||
Exercise failed parameter passing to user-defined code
|
||||
|
||||
The required Q parameter is missing
|
||||
17
tests/remap/fail/args.2/expected
Normal file
17
tests/remap/fail/args.2/expected
Normal file
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
user-defined M400: missing: P,Q
|
||||
O <rm400> call
|
||||
7 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
8 N..... SET_XY_ROTATION(0.0000)
|
||||
9 N..... SET_FEED_MODE(0, 0)
|
||||
10 N..... SET_FEED_RATE(0.0000)
|
||||
11 N..... STOP_SPINDLE_TURNING(0)
|
||||
12 N..... SET_SPINDLE_MODE(0 0.0000)
|
||||
13 N..... PROGRAM_END()
|
||||
14 N..... ON_RESET()
|
||||
18
tests/remap/fail/args.2/rm400.ngc
Normal file
18
tests/remap/fail/args.2/rm400.ngc
Normal file
@@ -0,0 +1,18 @@
|
||||
o<rm400> sub
|
||||
(debug, M400 call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
|
||||
o100 if [EXISTS[#<P>]]
|
||||
(debug, P word set: #<P>)
|
||||
o100 else
|
||||
(debug, P word missing)
|
||||
o100 endif
|
||||
|
||||
o120 if [EXISTS[#<Q>]]
|
||||
(debug, Q word set: #<Q>)
|
||||
o120 else
|
||||
(debug, Q word missing)
|
||||
o120 endif
|
||||
|
||||
o<rm400> endsub
|
||||
m2
|
||||
%
|
||||
9
tests/remap/fail/args.2/test.ini
Normal file
9
tests/remap/fail/args.2/test.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
SUBROUTINE_PATH = .
|
||||
|
||||
# M405 requires P- Q- and does NOT permit any other words in this block
|
||||
REMAP=M400 modalgroup=5 argspec=PQ ngc=rm400
|
||||
2
tests/remap/fail/args.2/test.ngc
Normal file
2
tests/remap/fail/args.2/test.ngc
Normal file
@@ -0,0 +1,2 @@
|
||||
M400 R122.25
|
||||
M2
|
||||
3
tests/remap/fail/args.2/test.sh
Executable file
3
tests/remap/fail/args.2/test.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
rs274 -i test.ini -n 0 -g test.ngc 2>&1
|
||||
exit "${PIPESTATUS[0]}"
|
||||
1
tests/remap/fail/body-ngc/README
Normal file
1
tests/remap/fail/body-ngc/README
Normal file
@@ -0,0 +1 @@
|
||||
Exercise failed remap NGC procedure - must properly return to top level
|
||||
20
tests/remap/fail/body-ngc/expected
Normal file
20
tests/remap/fail/body-ngc/expected
Normal file
@@ -0,0 +1,20 @@
|
||||
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")
|
||||
8 N..... MESSAGE(" in rm400: call_level= 1.000000 remap_level=1.000000")
|
||||
Attempt to divide by zero
|
||||
#100 = [1/0]
|
||||
9 N..... MESSAGE(" after failed M400: call_level= 0.000000 remap_level=0.000000")
|
||||
10 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
11 N..... SET_XY_ROTATION(0.0000)
|
||||
12 N..... SET_FEED_MODE(0, 0)
|
||||
13 N..... SET_FEED_RATE(0.0000)
|
||||
14 N..... STOP_SPINDLE_TURNING(0)
|
||||
15 N..... SET_SPINDLE_MODE(0 0.0000)
|
||||
16 N..... PROGRAM_END()
|
||||
17 N..... ON_RESET()
|
||||
6
tests/remap/fail/body-ngc/rm400.ngc
Normal file
6
tests/remap/fail/body-ngc/rm400.ngc
Normal file
@@ -0,0 +1,6 @@
|
||||
o<rm400> sub
|
||||
(debug, in rm400: call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
#100 = [1/0]
|
||||
o<rm400> endsub
|
||||
m2
|
||||
%
|
||||
9
tests/remap/fail/body-ngc/test.ini
Normal file
9
tests/remap/fail/body-ngc/test.ini
Normal file
@@ -0,0 +1,9 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
SUBROUTINE_PATH = .
|
||||
|
||||
REMAP=M400 modalgroup=5 ngc=rm400
|
||||
|
||||
4
tests/remap/fail/body-ngc/test.ngc
Normal file
4
tests/remap/fail/body-ngc/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-ngc/test.sh
Executable file
3
tests/remap/fail/body-ngc/test.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
rs274 -i test.ini -n 0 -g test.ngc 2>&1
|
||||
exit "${PIPESTATUS[0]}"
|
||||
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
|
||||
3
tests/remap/fail/canon_error/README
Normal file
3
tests/remap/fail/canon_error/README
Normal file
@@ -0,0 +1,3 @@
|
||||
Exercise CANON_ERROR
|
||||
|
||||
.. including embedding printf format-specifiers in the error string
|
||||
20
tests/remap/fail/canon_error/expected
Normal file
20
tests/remap/fail/canon_error/expected
Normal file
@@ -0,0 +1,20 @@
|
||||
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")
|
||||
8 N..... CANON_ERROR(%s is a literal percent s)
|
||||
A failed Python prolog returning INTERP_ERROR
|
||||
O <notcalled> call
|
||||
9 N..... MESSAGE(" after failed M400: call_level= 0.000000 remap_level=0.000000")
|
||||
10 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
11 N..... SET_XY_ROTATION(0.0000)
|
||||
12 N..... SET_FEED_MODE(0, 0)
|
||||
13 N..... SET_FEED_RATE(0.0000)
|
||||
14 N..... STOP_SPINDLE_TURNING(0)
|
||||
15 N..... SET_SPINDLE_MODE(0 0.0000)
|
||||
16 N..... PROGRAM_END()
|
||||
17 N..... ON_RESET()
|
||||
0
tests/remap/fail/canon_error/notcalled.ngc
Normal file
0
tests/remap/fail/canon_error/notcalled.ngc
Normal file
24
tests/remap/fail/canon_error/remap.py
Normal file
24
tests/remap/fail/canon_error/remap.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright (C) 2013 Jeff Epler <jepler@unpythonic.net>
|
||||
#
|
||||
# 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 emccanon
|
||||
import interpreter
|
||||
|
||||
def failingprolog(self,*args, **words):
|
||||
emccanon.CANON_ERROR("%s is a literal percent s")
|
||||
self.set_errormsg("A failed Python prolog returning INTERP_ERROR")
|
||||
return interpreter.INTERP_ERROR
|
||||
|
||||
|
||||
16
tests/remap/fail/canon_error/subs.py
Normal file
16
tests/remap/fail/canon_error/subs.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright (C) 2013 Jeff Epler <jepler@unpythonic.net>
|
||||
#
|
||||
# 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
|
||||
15
tests/remap/fail/canon_error/test.ini
Normal file
15
tests/remap/fail/canon_error/test.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
SUBROUTINE_PATH = .
|
||||
|
||||
REMAP=M400 modalgroup=5 prolog=failingprolog ngc=notcalled
|
||||
|
||||
[PYTHON]
|
||||
PATH_PREPEND=.
|
||||
TOPLEVEL=subs.py
|
||||
|
||||
|
||||
|
||||
4
tests/remap/fail/canon_error/test.ngc
Normal file
4
tests/remap/fail/canon_error/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
|
||||
5
tests/remap/fail/canon_error/test.sh
Executable file
5
tests/remap/fail/canon_error/test.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
export PYTHONUNBUFFERED=1
|
||||
rs274 -i test.ini -n 0 -g test.ngc 2>&1
|
||||
# expected to fail
|
||||
exit 0
|
||||
3
tests/remap/fail/epilog/README
Normal file
3
tests/remap/fail/epilog/README
Normal file
@@ -0,0 +1,3 @@
|
||||
Exercise failed prolog for a remap NGC procedure
|
||||
|
||||
must properly return to top level, convey error text
|
||||
13
tests/remap/fail/epilog/expected
Normal file
13
tests/remap/fail/epilog/expected
Normal file
@@ -0,0 +1,13 @@
|
||||
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")
|
||||
8 N..... MESSAGE(" I should complain if I weren't called but I guess I can not do that")
|
||||
9 N..... MESSAGE("failing_epilog returning INTERP_ERROR")
|
||||
A failed Python epilog returning INTERP_ERROR
|
||||
o<mustbecalled>endsub
|
||||
10 N..... ON_RESET()
|
||||
4
tests/remap/fail/epilog/mustbecalled.ngc
Normal file
4
tests/remap/fail/epilog/mustbecalled.ngc
Normal file
@@ -0,0 +1,4 @@
|
||||
o<mustbecalled>sub
|
||||
(debug, I should complain if I weren't called but I guess I can not do that)
|
||||
o<mustbecalled>endsub
|
||||
m2
|
||||
26
tests/remap/fail/epilog/remap.py
Normal file
26
tests/remap/fail/epilog/remap.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# 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 emccanon
|
||||
import interpreter
|
||||
|
||||
def failingepilog(self,*args, **words):
|
||||
emccanon.MESSAGE("failing_epilog returning INTERP_ERROR")
|
||||
self.set_errormsg("A failed Python epilog returning INTERP_ERROR")
|
||||
return interpreter.INTERP_ERROR
|
||||
|
||||
|
||||
19
tests/remap/fail/epilog/subs.py
Normal file
19
tests/remap/fail/epilog/subs.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# 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
|
||||
|
||||
15
tests/remap/fail/epilog/test.ini
Normal file
15
tests/remap/fail/epilog/test.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[PYTHON]
|
||||
PATH_PREPEND=.
|
||||
TOPLEVEL=subs.py
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
|
||||
LOG_LEVEL=0
|
||||
SUBROUTINE_PATH = .
|
||||
REMAP=M400 modalgroup=5 ngc=mustbecalled epilog=failingepilog
|
||||
|
||||
7
tests/remap/fail/epilog/test.ngc
Normal file
7
tests/remap/fail/epilog/test.ngc
Normal file
@@ -0,0 +1,7 @@
|
||||
(debug, before M400: call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
M400
|
||||
(this should NOT execute because the failed epilog is supposed to abort!)
|
||||
|
||||
(debug, after failed M400: call_level= #<_call_level> remap_level=#<_remap_level>)
|
||||
M2
|
||||
|
||||
3
tests/remap/fail/epilog/test.sh
Executable file
3
tests/remap/fail/epilog/test.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
export PYTHONUNBUFFERED=1
|
||||
! rs274 -i test.ini -n 2 -g test.ngc 2>&1
|
||||
3
tests/remap/fail/prolog/README
Normal file
3
tests/remap/fail/prolog/README
Normal file
@@ -0,0 +1,3 @@
|
||||
Exercise failed prolog for a remap NGC procedure
|
||||
|
||||
must properly return to top level, convey error text
|
||||
20
tests/remap/fail/prolog/expected
Normal file
20
tests/remap/fail/prolog/expected
Normal file
@@ -0,0 +1,20 @@
|
||||
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")
|
||||
8 N..... MESSAGE("failingprolog returning INTERP_ERROR")
|
||||
A failed Python prolog returning INTERP_ERROR
|
||||
O <notcalled> call
|
||||
9 N..... MESSAGE(" after failed M400: call_level= 0.000000 remap_level=0.000000")
|
||||
10 N..... SET_G5X_OFFSET(1, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000, 0.0000)
|
||||
11 N..... SET_XY_ROTATION(0.0000)
|
||||
12 N..... SET_FEED_MODE(0, 0)
|
||||
13 N..... SET_FEED_RATE(0.0000)
|
||||
14 N..... STOP_SPINDLE_TURNING(0)
|
||||
15 N..... SET_SPINDLE_MODE(0 0.0000)
|
||||
16 N..... PROGRAM_END()
|
||||
17 N..... ON_RESET()
|
||||
0
tests/remap/fail/prolog/notcalled.ngc
Normal file
0
tests/remap/fail/prolog/notcalled.ngc
Normal file
26
tests/remap/fail/prolog/remap.py
Normal file
26
tests/remap/fail/prolog/remap.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# 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 emccanon
|
||||
import interpreter
|
||||
|
||||
def failingprolog(self,*args, **words):
|
||||
emccanon.MESSAGE("failingprolog returning INTERP_ERROR")
|
||||
self.set_errormsg("A failed Python prolog returning INTERP_ERROR")
|
||||
return interpreter.INTERP_ERROR
|
||||
|
||||
|
||||
18
tests/remap/fail/prolog/subs.py
Normal file
18
tests/remap/fail/prolog/subs.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# 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
|
||||
15
tests/remap/fail/prolog/test.ini
Normal file
15
tests/remap/fail/prolog/test.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[EMC]
|
||||
DEBUG=0
|
||||
LOG_LEVEL=0
|
||||
|
||||
[RS274NGC]
|
||||
SUBROUTINE_PATH = .
|
||||
|
||||
REMAP=M400 modalgroup=5 prolog=failingprolog ngc=notcalled
|
||||
|
||||
[PYTHON]
|
||||
PATH_PREPEND=.
|
||||
TOPLEVEL=subs.py
|
||||
|
||||
|
||||
|
||||
4
tests/remap/fail/prolog/test.ngc
Normal file
4
tests/remap/fail/prolog/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
|
||||
5
tests/remap/fail/prolog/test.sh
Executable file
5
tests/remap/fail/prolog/test.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
export PYTHONUNBUFFERED=1
|
||||
rs274 -i test.ini -n 0 -g test.ngc 2>&1
|
||||
# expected to fail
|
||||
exit 0
|
||||
Reference in New Issue
Block a user