TestApp.py

Go to the documentation of this file.
00001 #***************************************************************************
00002 #*   (c) Juergen Riegel (juergen.riegel@web.de) 2002                       *   
00003 #*                                                                         *
00004 #*   This file is part of the FreeCAD CAx development system.              *
00005 #*                                                                         *
00006 #*   This program is free software; you can redistribute it and/or modify  *
00007 #*   it under the terms of the GNU Lesser General Public License (LGPL)    *
00008 #*   as published by the Free Software Foundation; either version 2 of     *
00009 #*   the License, or (at your option) any later version.                   *
00010 #*   for detail see the LICENCE text file.                                 *
00011 #*                                                                         *
00012 #*   FreeCAD is distributed in the hope that it will be useful,            *
00013 #*   but WITHOUT ANY WARRANTY; without even the implied warranty of        * 
00014 #*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015 #*   GNU Library General Public License for more details.                  *
00016 #*                                                                         *
00017 #*   You should have received a copy of the GNU Library General Public     *
00018 #*   License along with FreeCAD; if not, write to the Free Software        * 
00019 #*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
00020 #*   USA                                                                   *
00021 #*                                                                         *
00022 #*   Juergen Riegel 2002                                                   *
00023 #***************************************************************************/
00024 
00025 import FreeCAD, os, unittest
00026 
00027         
00028 #---------------------------------------------------------------------------
00029 # define the functions to test the FreeCAD base code
00030 #---------------------------------------------------------------------------
00031 
00032 
00033 def All():
00034     suite = unittest.TestSuite()
00035     # Base system tests
00036     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("UnicodeTests") )
00037     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("Document") )
00038     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("UnitTests") )
00039     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("BaseTests") )
00040     # Base system gui test
00041     if ( FreeCAD.GuiUp == 1):
00042         suite.addTest(unittest.defaultTestLoader.loadTestsFromName("Workbench") )
00043         suite.addTest(unittest.defaultTestLoader.loadTestsFromName("Menu") )
00044     # add the module tests
00045     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("MeshTestsApp") )
00046     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("TestSketcherApp") )
00047     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("TestPartApp") )
00048     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("TestPartDesignApp") )
00049     # gui tests of modules
00050     if ( FreeCAD.GuiUp == 1):
00051         suite.addTest(unittest.defaultTestLoader.loadTestsFromName("TestSketcherGui") )
00052         suite.addTest(unittest.defaultTestLoader.loadTestsFromName("TestPartGui") )
00053         suite.addTest(unittest.defaultTestLoader.loadTestsFromName("TestPartDesignGui") )
00054     return suite
00055 
00056     
00057 def TestText(s):
00058     s = unittest.defaultTestLoader.loadTestsFromName(s)
00059     r = unittest.TextTestRunner()
00060     r.run(s)
00061 
00062 def Test(s):
00063     TestText(s)
00064 
00065 def testAll():
00066     TestText(All())
00067 
00068 def testUnit():
00069     TestText(unittest.TestLoader().loadTestsFromName('UnitTests'))
00070 
00071 def testDocument():
00072     suite = unittest.TestSuite()
00073     suite.addTest(unittest.defaultTestLoader.loadTestsFromName("Document") )
00074     TestText(suite)
00075 
00076 
00077 

Generated on Wed Nov 23 19:00:45 2011 for FreeCAD by  doxygen 1.6.1