diff options
author | Michael Haberler <git@mah.priv.at> | 2011-06-03 19:03:46 +0200 |
---|---|---|
committer | Michael Haberler <git@mah.priv.at> | 2011-10-28 08:25:39 +0200 |
commit | fdb906243da808fcb9539d2f5344c56401ec58d6 (patch) | |
tree | fe906699360df350c1f06fc2c409e0e884a99924 | |
parent | b27bd36b63562b33d535458a7af0a2a5a2822ca8 (diff) | |
download | linuxcnc-fdb906243da808fcb9539d2f5344c56401ec58d6.tar.gz linuxcnc-fdb906243da808fcb9539d2f5344c56401ec58d6.zip |
interp/remap: sequencing regression
regardless of the permutation the order must follow execution order
-rw-r--r-- | tests/remap/sequencing/README | 4 | ||||
-rw-r--r-- | tests/remap/sequencing/expected | 17 | ||||
-rw-r--r-- | tests/remap/sequencing/permute.py | 31 | ||||
-rw-r--r-- | tests/remap/sequencing/rg881.ngc | 5 | ||||
-rw-r--r-- | tests/remap/sequencing/rm405.ngc | 5 | ||||
-rw-r--r-- | tests/remap/sequencing/rm406.ngc | 5 | ||||
-rw-r--r-- | tests/remap/sequencing/rm407.ngc | 5 | ||||
-rw-r--r-- | tests/remap/sequencing/rm408.ngc | 5 | ||||
-rw-r--r-- | tests/remap/sequencing/rm409.ngc | 5 | ||||
-rw-r--r-- | tests/remap/sequencing/rm410.ngc | 5 | ||||
-rw-r--r-- | tests/remap/sequencing/test.ini | 16 | ||||
-rw-r--r-- | tests/remap/sequencing/test.ngc | 245 | ||||
-rwxr-xr-x | tests/remap/sequencing/test.sh | 4 |
13 files changed, 352 insertions, 0 deletions
diff --git a/tests/remap/sequencing/README b/tests/remap/sequencing/README new file mode 100644 index 000000000..54c4124dd --- /dev/null +++ b/tests/remap/sequencing/README @@ -0,0 +1,4 @@ +Exercise remap sequencing of up to 4 M-codes per line (MAX_EMS limit) + +regardless of ordering of mcodes on the line the execution order +must reflect an ascending sequence diff --git a/tests/remap/sequencing/expected b/tests/remap/sequencing/expected new file mode 100644 index 000000000..739e9544c --- /dev/null +++ b/tests/remap/sequencing/expected @@ -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..... MESSAGE(" call_level=1.000000 remap_level=1.000000") + N..... MESSAGE(" call_level=2.000000 remap_level=2.000000") + N..... MESSAGE(" call_level=3.000000 remap_level=3.000000") + N..... MESSAGE(" call_level=4.000000 remap_level=4.000000") + N..... MESSAGE("call_level=0.000000 remap_level=0.000000") + 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) + N..... SET_FEED_RATE(0.0000) + N..... STOP_SPINDLE_TURNING() + N..... SET_SPINDLE_MODE(0.0000) + N..... PROGRAM_END() diff --git a/tests/remap/sequencing/permute.py b/tests/remap/sequencing/permute.py new file mode 100644 index 000000000..82e8df8ae --- /dev/null +++ b/tests/remap/sequencing/permute.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +#http://stackoverflow.com/questions/361/generate-list-of-all-possible-permutations-of-a-string +def nextPermutation(perm): + k0 = None + for i in range(len(perm)-1): + if perm[i]<perm[i+1]: + k0=i + if k0 == None: + return None + + l0 = k0+1 + for i in range(k0+1, len(perm)): + if perm[k0] < perm[i]: + l0 = i + + perm[k0], perm[l0] = perm[l0], perm[k0] + perm[k0+1:] = reversed(perm[k0+1:]) + return perm + + +perm=["g88.1x1", "m405","m406","m407","m408"] + +while perm: + print perm + perm = nextPermutation(perm) + +perm=["g88.1x1", "m407","m408","m409","m410"] + +while perm: + print perm + perm = nextPermutation(perm) diff --git a/tests/remap/sequencing/rg881.ngc b/tests/remap/sequencing/rg881.ngc new file mode 100644 index 000000000..b17b6724d --- /dev/null +++ b/tests/remap/sequencing/rg881.ngc @@ -0,0 +1,5 @@ +o<rg881> sub +(debug,rg881 call_level=#<_call_level> remap_level=#<_remap_level>) +o<rg881> endsub +m2 +% diff --git a/tests/remap/sequencing/rm405.ngc b/tests/remap/sequencing/rm405.ngc new file mode 100644 index 000000000..6f35088a0 --- /dev/null +++ b/tests/remap/sequencing/rm405.ngc @@ -0,0 +1,5 @@ +o<rm405> sub +(debug,m405 call_level=#<_call_level> remap_level=#<_remap_level>) +o<rm405> endsub +m2 +% diff --git a/tests/remap/sequencing/rm406.ngc b/tests/remap/sequencing/rm406.ngc new file mode 100644 index 000000000..2a4ebfe30 --- /dev/null +++ b/tests/remap/sequencing/rm406.ngc @@ -0,0 +1,5 @@ +o<rm406> sub +(debug,m406 call_level=#<_call_level> remap_level=#<_remap_level>) +o<rm406> endsub +m2 +% diff --git a/tests/remap/sequencing/rm407.ngc b/tests/remap/sequencing/rm407.ngc new file mode 100644 index 000000000..76119a643 --- /dev/null +++ b/tests/remap/sequencing/rm407.ngc @@ -0,0 +1,5 @@ +o<rm407> sub +(debug,m407 call_level=#<_call_level> remap_level=#<_remap_level>) +o<rm407> endsub +m2 +% diff --git a/tests/remap/sequencing/rm408.ngc b/tests/remap/sequencing/rm408.ngc new file mode 100644 index 000000000..20505ae66 --- /dev/null +++ b/tests/remap/sequencing/rm408.ngc @@ -0,0 +1,5 @@ +o<rm408> sub +(debug,m408 call_level=#<_call_level> remap_level=#<_remap_level>) +o<rm408> endsub +m2 +% diff --git a/tests/remap/sequencing/rm409.ngc b/tests/remap/sequencing/rm409.ngc new file mode 100644 index 000000000..3f202419e --- /dev/null +++ b/tests/remap/sequencing/rm409.ngc @@ -0,0 +1,5 @@ +o<rm409> sub +(debug,m409 call_level=#<_call_level> remap_level=#<_remap_level>) +o<rm409> endsub +m2 +% diff --git a/tests/remap/sequencing/rm410.ngc b/tests/remap/sequencing/rm410.ngc new file mode 100644 index 000000000..3d11c8b6e --- /dev/null +++ b/tests/remap/sequencing/rm410.ngc @@ -0,0 +1,5 @@ +o<rm410> sub +(debug,m410 call_level=#<_call_level> remap_level=#<_remap_level>) +o<rm410> endsub +m2 +% diff --git a/tests/remap/sequencing/test.ini b/tests/remap/sequencing/test.ini new file mode 100644 index 000000000..356d12764 --- /dev/null +++ b/tests/remap/sequencing/test.ini @@ -0,0 +1,16 @@ +[EMC] +DEBUG=0 +LOG_LEVEL=0 + +[RS274NGC] +SUBROUTINE_PATH = . + +REMAP=G88.1 modalgroup=1 argspec=- ngc=rg881 + +# one M-code from each modal group +REMAP=M405 modalgroup=5 argspec=- ngc=rm405 +REMAP=M406 modalgroup=6 argspec=- ngc=rm406 +REMAP=M407 modalgroup=7 argspec=- ngc=rm407 +REMAP=M408 modalgroup=8 argspec=- ngc=rm408 +REMAP=M409 modalgroup=9 argspec=- ngc=rm409 +REMAP=M410 modalgroup=10 argspec=- ngc=rm410 diff --git a/tests/remap/sequencing/test.ngc b/tests/remap/sequencing/test.ngc new file mode 100644 index 000000000..91a63625d --- /dev/null +++ b/tests/remap/sequencing/test.ngc @@ -0,0 +1,245 @@ +; one G, 4 M-codes per line + +g88.1x1 m405 m406 m407 m408 +g88.1x1 m405 m406 m408 m407 +g88.1x1 m405 m407 m406 m408 +g88.1x1 m405 m407 m408 m406 +g88.1x1 m405 m408 m406 m407 +g88.1x1 m405 m408 m407 m406 +g88.1x1 m406 m405 m407 m408 +g88.1x1 m406 m405 m408 m407 +g88.1x1 m406 m407 m405 m408 +g88.1x1 m406 m407 m408 m405 +g88.1x1 m406 m408 m405 m407 +g88.1x1 m406 m408 m407 m405 +g88.1x1 m407 m405 m406 m408 +g88.1x1 m407 m405 m408 m406 +g88.1x1 m407 m406 m405 m408 +g88.1x1 m407 m406 m408 m405 +g88.1x1 m407 m408 m405 m406 +g88.1x1 m407 m408 m406 m405 +g88.1x1 m408 m405 m406 m407 +g88.1x1 m408 m405 m407 m406 +g88.1x1 m408 m406 m405 m407 +g88.1x1 m408 m406 m407 m405 +g88.1x1 m408 m407 m405 m406 +g88.1x1 m408 m407 m406 m405 +m405 g88.1x1 m406 m407 m408 +m405 g88.1x1 m406 m408 m407 +m405 g88.1x1 m407 m406 m408 +m405 g88.1x1 m407 m408 m406 +m405 g88.1x1 m408 m406 m407 +m405 g88.1x1 m408 m407 m406 +m405 m406 g88.1x1 m407 m408 +m405 m406 g88.1x1 m408 m407 +m405 m406 m407 g88.1x1 m408 +m405 m406 m407 m408 g88.1x1 +m405 m406 m408 g88.1x1 m407 +m405 m406 m408 m407 g88.1x1 +m405 m407 g88.1x1 m406 m408 +m405 m407 g88.1x1 m408 m406 +m405 m407 m406 g88.1x1 m408 +m405 m407 m406 m408 g88.1x1 +m405 m407 m408 g88.1x1 m406 +m405 m407 m408 m406 g88.1x1 +m405 m408 g88.1x1 m406 m407 +m405 m408 g88.1x1 m407 m406 +m405 m408 m406 g88.1x1 m407 +m405 m408 m406 m407 g88.1x1 +m405 m408 m407 g88.1x1 m406 +m405 m408 m407 m406 g88.1x1 +m406 g88.1x1 m405 m407 m408 +m406 g88.1x1 m405 m408 m407 +m406 g88.1x1 m407 m405 m408 +m406 g88.1x1 m407 m408 m405 +m406 g88.1x1 m408 m405 m407 +m406 g88.1x1 m408 m407 m405 +m406 m405 g88.1x1 m407 m408 +m406 m405 g88.1x1 m408 m407 +m406 m405 m407 g88.1x1 m408 +m406 m405 m407 m408 g88.1x1 +m406 m405 m408 g88.1x1 m407 +m406 m405 m408 m407 g88.1x1 +m406 m407 g88.1x1 m405 m408 +m406 m407 g88.1x1 m408 m405 +m406 m407 m405 g88.1x1 m408 +m406 m407 m405 m408 g88.1x1 +m406 m407 m408 g88.1x1 m405 +m406 m407 m408 m405 g88.1x1 +m406 m408 g88.1x1 m405 m407 +m406 m408 g88.1x1 m407 m405 +m406 m408 m405 g88.1x1 m407 +m406 m408 m405 m407 g88.1x1 +m406 m408 m407 g88.1x1 m405 +m406 m408 m407 m405 g88.1x1 +m407 g88.1x1 m405 m406 m408 +m407 g88.1x1 m405 m408 m406 +m407 g88.1x1 m406 m405 m408 +m407 g88.1x1 m406 m408 m405 +m407 g88.1x1 m408 m405 m406 +m407 g88.1x1 m408 m406 m405 +m407 m405 g88.1x1 m406 m408 +m407 m405 g88.1x1 m408 m406 +m407 m405 m406 g88.1x1 m408 +m407 m405 m406 m408 g88.1x1 +m407 m405 m408 g88.1x1 m406 +m407 m405 m408 m406 g88.1x1 +m407 m406 g88.1x1 m405 m408 +m407 m406 g88.1x1 m408 m405 +m407 m406 m405 g88.1x1 m408 +m407 m406 m405 m408 g88.1x1 +m407 m406 m408 g88.1x1 m405 +m407 m406 m408 m405 g88.1x1 +m407 m408 g88.1x1 m405 m406 +m407 m408 g88.1x1 m406 m405 +m407 m408 m405 g88.1x1 m406 +m407 m408 m405 m406 g88.1x1 +m407 m408 m406 g88.1x1 m405 +m407 m408 m406 m405 g88.1x1 +m408 g88.1x1 m405 m406 m407 +m408 g88.1x1 m405 m407 m406 +m408 g88.1x1 m406 m405 m407 +m408 g88.1x1 m406 m407 m405 +m408 g88.1x1 m407 m405 m406 +m408 g88.1x1 m407 m406 m405 +m408 m405 g88.1x1 m406 m407 +m408 m405 g88.1x1 m407 m406 +m408 m405 m406 g88.1x1 m407 +m408 m405 m406 m407 g88.1x1 +m408 m405 m407 g88.1x1 m406 +m408 m405 m407 m406 g88.1x1 +m408 m406 g88.1x1 m405 m407 +m408 m406 g88.1x1 m407 m405 +m408 m406 m405 g88.1x1 m407 +m408 m406 m405 m407 g88.1x1 +m408 m406 m407 g88.1x1 m405 +m408 m406 m407 m405 g88.1x1 +m408 m407 g88.1x1 m405 m406 +m408 m407 g88.1x1 m406 m405 +m408 m407 m405 g88.1x1 m406 +m408 m407 m405 m406 g88.1x1 +m408 m407 m406 g88.1x1 m405 +m408 m407 m406 m405 g88.1x1 +g88.1x1 m407 m408 m409 m410 +g88.1x1 m407 m408 m410 m409 +g88.1x1 m407 m409 m408 m410 +g88.1x1 m407 m409 m410 m408 +g88.1x1 m407 m410 m408 m409 +g88.1x1 m407 m410 m409 m408 +g88.1x1 m408 m407 m409 m410 +g88.1x1 m408 m407 m410 m409 +g88.1x1 m408 m409 m407 m410 +g88.1x1 m408 m409 m410 m407 +g88.1x1 m408 m410 m407 m409 +g88.1x1 m408 m410 m409 m407 +g88.1x1 m409 m407 m408 m410 +g88.1x1 m409 m407 m410 m408 +g88.1x1 m409 m408 m407 m410 +g88.1x1 m409 m408 m410 m407 +g88.1x1 m409 m410 m407 m408 +g88.1x1 m409 m410 m408 m407 +g88.1x1 m410 m407 m408 m409 +g88.1x1 m410 m407 m409 m408 +g88.1x1 m410 m408 m407 m409 +g88.1x1 m410 m408 m409 m407 +g88.1x1 m410 m409 m407 m408 +g88.1x1 m410 m409 m408 m407 +m407 g88.1x1 m408 m409 m410 +m407 g88.1x1 m408 m410 m409 +m407 g88.1x1 m409 m408 m410 +m407 g88.1x1 m409 m410 m408 +m407 g88.1x1 m410 m408 m409 +m407 g88.1x1 m410 m409 m408 +m407 m408 g88.1x1 m409 m410 +m407 m408 g88.1x1 m410 m409 +m407 m408 m409 g88.1x1 m410 +m407 m408 m409 m410 g88.1x1 +m407 m408 m410 g88.1x1 m409 +m407 m408 m410 m409 g88.1x1 +m407 m409 g88.1x1 m408 m410 +m407 m409 g88.1x1 m410 m408 +m407 m409 m408 g88.1x1 m410 +m407 m409 m408 m410 g88.1x1 +m407 m409 m410 g88.1x1 m408 +m407 m409 m410 m408 g88.1x1 +m407 m410 g88.1x1 m408 m409 +m407 m410 g88.1x1 m409 m408 +m407 m410 m408 g88.1x1 m409 +m407 m410 m408 m409 g88.1x1 +m407 m410 m409 g88.1x1 m408 +m407 m410 m409 m408 g88.1x1 +m408 g88.1x1 m407 m409 m410 +m408 g88.1x1 m407 m410 m409 +m408 g88.1x1 m409 m407 m410 +m408 g88.1x1 m409 m410 m407 +m408 g88.1x1 m410 m407 m409 +m408 g88.1x1 m410 m409 m407 +m408 m407 g88.1x1 m409 m410 +m408 m407 g88.1x1 m410 m409 +m408 m407 m409 g88.1x1 m410 +m408 m407 m409 m410 g88.1x1 +m408 m407 m410 g88.1x1 m409 +m408 m407 m410 m409 g88.1x1 +m408 m409 g88.1x1 m407 m410 +m408 m409 g88.1x1 m410 m407 +m408 m409 m407 g88.1x1 m410 +m408 m409 m407 m410 g88.1x1 +m408 m409 m410 g88.1x1 m407 +m408 m409 m410 m407 g88.1x1 +m408 m410 g88.1x1 m407 m409 +m408 m410 g88.1x1 m409 m407 +m408 m410 m407 g88.1x1 m409 +m408 m410 m407 m409 g88.1x1 +m408 m410 m409 g88.1x1 m407 +m408 m410 m409 m407 g88.1x1 +m409 g88.1x1 m407 m408 m410 +m409 g88.1x1 m407 m410 m408 +m409 g88.1x1 m408 m407 m410 +m409 g88.1x1 m408 m410 m407 +m409 g88.1x1 m410 m407 m408 +m409 g88.1x1 m410 m408 m407 +m409 m407 g88.1x1 m408 m410 +m409 m407 g88.1x1 m410 m408 +m409 m407 m408 g88.1x1 m410 +m409 m407 m408 m410 g88.1x1 +m409 m407 m410 g88.1x1 m408 +m409 m407 m410 m408 g88.1x1 +m409 m408 g88.1x1 m407 m410 +m409 m408 g88.1x1 m410 m407 +m409 m408 m407 g88.1x1 m410 +m409 m408 m407 m410 g88.1x1 +m409 m408 m410 g88.1x1 m407 +m409 m408 m410 m407 g88.1x1 +m409 m410 g88.1x1 m407 m408 +m409 m410 g88.1x1 m408 m407 +m409 m410 m407 g88.1x1 m408 +m409 m410 m407 m408 g88.1x1 +m409 m410 m408 g88.1x1 m407 +m409 m410 m408 m407 g88.1x1 +m410 g88.1x1 m407 m408 m409 +m410 g88.1x1 m407 m409 m408 +m410 g88.1x1 m408 m407 m409 +m410 g88.1x1 m408 m409 m407 +m410 g88.1x1 m409 m407 m408 +m410 g88.1x1 m409 m408 m407 +m410 m407 g88.1x1 m408 m409 +m410 m407 g88.1x1 m409 m408 +m410 m407 m408 g88.1x1 m409 +m410 m407 m408 m409 g88.1x1 +m410 m407 m409 g88.1x1 m408 +m410 m407 m409 m408 g88.1x1 +m410 m408 g88.1x1 m407 m409 +m410 m408 g88.1x1 m409 m407 +m410 m408 m407 g88.1x1 m409 +m410 m408 m407 m409 g88.1x1 +m410 m408 m409 g88.1x1 m407 +m410 m408 m409 m407 g88.1x1 +m410 m409 g88.1x1 m407 m408 +m410 m409 g88.1x1 m408 m407 +m410 m409 m407 g88.1x1 m408 +m410 m409 m407 m408 g88.1x1 +m410 m409 m408 g88.1x1 m407 +m410 m409 m408 m407 g88.1x1 + +m2 +% diff --git a/tests/remap/sequencing/test.sh b/tests/remap/sequencing/test.sh new file mode 100755 index 000000000..13adf7d5c --- /dev/null +++ b/tests/remap/sequencing/test.sh @@ -0,0 +1,4 @@ +#!/bin/bash +export INI_FILE_NAME=test.ini +rs274 -i $INI_FILE_NAME -g test.ngc | awk '{$1=""; print}' +exit ${PIPESTATUS[0]} |