Add test for imperial linuxcnc

This commit is contained in:
sliptonic
2017-09-18 22:59:48 -05:00
committed by wmayer
parent 7a384f62bc
commit 3d322773fd
2 changed files with 19 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ class PathPostTestCases(unittest.TestCase):
def testLinuxCNC(self):
from PathScripts.post import linuxcnc_post as postprocessor
args = '--no-header --no-line-numbers --no-comments --no-show-editor --output-precision=2'
args = '--no-header --no-line-numbers --no-comments --no-show-editor --precision=2'
gcode = postprocessor.export(self.postlist, 'gcode.tmp', args)
referenceFile = FreeCAD.getHomePath() + 'Mod/Path/PathTests/test_linuxcnc_00.ngc'
@@ -71,6 +71,24 @@ class PathPostTestCases(unittest.TestCase):
msg = ''.join(difflib.ndiff(gcode.splitlines(True), refGCode.splitlines(True)))
self.fail("linuxcnc output doesn't match: " + msg)
def testLinuxCNCImperial(self):
from PathScripts.post import linuxcnc_post as postprocessor
args = '--no-header --no-line-numbers --no-comments --no-show-editor --precision=2 --inches'
gcode = postprocessor.export(self.postlist, 'gcode.tmp', args)
referenceFile = FreeCAD.getHomePath() + 'Mod/Path/PathTests/test_linuxcnc_10.ngc'
with open(referenceFile, 'r') as fp:
refGCode = fp.read()
# Use if this test fails in order to have a real good look at the changes
if False:
with open('tab.tmp', 'w') as fp:
fp.write(gcode)
if gcode != refGCode:
msg = ''.join(difflib.ndiff(gcode.splitlines(True), refGCode.splitlines(True)))
self.fail("linuxcnc output doesn't match: " + msg)
def testCentroid(self):
from PathScripts.post import centroid_post as postprocessor
args = '--no-header --no-line-numbers --no-comments --no-show-editor --axis-precision=2 --feed-precision=2'

Binary file not shown.