diff --git a/src/Mod/Path/PathTests/TestPathPost.py b/src/Mod/Path/PathTests/TestPathPost.py index fbdfe67ae7..06007f0971 100644 --- a/src/Mod/Path/PathTests/TestPathPost.py +++ b/src/Mod/Path/PathTests/TestPathPost.py @@ -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' diff --git a/src/Mod/Path/PathTests/boxtest.fcstd b/src/Mod/Path/PathTests/boxtest.fcstd index fc8f2bf740..cc338da2d8 100644 Binary files a/src/Mod/Path/PathTests/boxtest.fcstd and b/src/Mod/Path/PathTests/boxtest.fcstd differ