# Path: drawingDimensioning/core.py
# def debugPrint( level, msg ):
# def findUnusedObjectName(base, counterStart=1, fmt='%03i'):
# def errorMessagebox_with_traceback(title='Error'):
# def getDrawingPageGUIVars():
#     def __init__(self, data):
# def recomputeWithOutViewReset( drawingVars ):
# def printGraphicsViewInfo( drawingVars ):
#     def Activated(self):
#     def GetResources(self): 
# def dimensionableObjects ( page ):
# class DrawingPageGUIVars:
# class helpCommand:
#     T = gV.transform()
#     T = drawingVars.graphicsView.transform()


import unittest
import sys, os
    import FreeCAD, FreeCADGui
import argparse
import drawingDimensioning
from PySide import QtGui, QtSvg, QtCore  
from drawingDimensioning.core import __dir__, debugPrint

FreeCADGui.addCommand = addCommand_check

app = QtGui.QApplication([])
#need to be defined before drawingDimensioning , else Qt crashes

parser = argparse.ArgumentParser()
parser.add_argument('--failfast', action='store_true', help='Stop the test run on the first error or failure.')
parser.add_argument('--buffer', action='store_true', help='The standard output and standard error streams are buffered during the test run. Output during a passing test is discarded. Output is echoed normally on test fail or error and is added to the failure messages.')
parser.add_argument('-v','--verbosity', type=int, default=1 )
parser.add_argument('--no_descriptions', action='store_true' )
parser.add_argument('testSuiteName',  type=str, nargs='*')
args = parser.parse_args()

debugPrint.level = 0

testLoader = unittest.TestLoader()
if args.testSuiteName == []:
    suite = testLoader.discover(
        start_dir = os.path.join( __dir__ , 'test' ),
        pattern='test*.py',
        top_level_dir=None
    )
else:
    suite = unittest.TestSuite()
    for name in args.testSuiteName:
        suite.addTest( testLoader.loadTestsFromName(name ) )

runner = unittest.TextTestRunner(
    failfast = args.failfast,

# Path: drawingDimensioning/core.py
# def debugPrint( level, msg ):
# def findUnusedObjectName(base, counterStart=1, fmt='%03i'):
# def errorMessagebox_with_traceback(title='Error'):
# def getDrawingPageGUIVars():
#     def __init__(self, data):
# def recomputeWithOutViewReset( drawingVars ):
# def printGraphicsViewInfo( drawingVars ):
#     def Activated(self):
#     def GetResources(self): 
# def dimensionableObjects ( page ):
# class DrawingPageGUIVars:
# class helpCommand:
#     T = gV.transform()
#     T = drawingVars.graphicsView.transform()


# Path: test/__main__.py
import unittest
import sys, os
    import FreeCAD, FreeCADGui
import argparse
import drawingDimensioning
from PySide import QtGui, QtSvg, QtCore  
from drawingDimensioning.core import __dir__, debugPrint


FreeCADGui.addCommand = addCommand_check

app = QtGui.QApplication([])
#need to be defined before drawingDimensioning , else Qt crashes

parser = argparse.ArgumentParser()
parser.add_argument('--failfast', action='store_true', help='Stop the test run on the first error or failure.')
parser.add_argument('--buffer', action='store_true', help='The standard output and standard error streams are buffered during the test run. Output during a passing test is discarded. Output is echoed normally on test fail or error and is added to the failure messages.')
parser.add_argument('-v','--verbosity', type=int, default=1 )
parser.add_argument('--no_descriptions', action='store_true' )
parser.add_argument('testSuiteName',  type=str, nargs='*')
args = parser.parse_args()

debugPrint.level = 0

testLoader = unittest.TestLoader()
if args.testSuiteName == []:
    suite = testLoader.discover(
        start_dir = os.path.join( __dir__ , 'test' ),
        pattern='test*.py',
        top_level_dir=None
    )
else:
    suite = unittest.TestSuite()
    for name in args.testSuiteName:
        suite.addTest( testLoader.loadTestsFromName(name ) )

runner = unittest.TextTestRunner(
    failfast = args.failfast,

    verbosity = args.verbosity,