https://wiki.freecad.org/api.php?action=feedcontributions&user=Topcyde&feedformat=atomFreeCAD Documentation - User contributions [en]2024-03-29T06:21:51ZUser contributionsMediaWiki 1.40.1https://wiki.freecad.org/index.php?title=Testing&diff=124639Testing2014-11-22T19:04:11Z<p>Topcyde: Improved the stye of the page layout</p>
<hr />
<div><translate><br />
<!--T:1--><br />
FreeCAD comes with an extensive testing framework. The testing bases on a set of Python scripts which are located in the test module.<br />
<br />
== Introduction ==<!--T:2--><br />
This is the list of test apps as of 0.15 Git 4207:<br />
<br />
=== TestAPP.All ===<!--T:3--><br />
Add test funtion<br />
<br />
=== BaseTests ===<!--T:5--><br />
Add test funtion<br />
<br />
=== UnitTests ===<!--T:6--><br />
Add test funtion<br />
<br />
=== Document ===<!--T:7--><br />
Add test funtion<br />
<br />
=== UnicodeTests ===<!--T:8--><br />
Add test funtion<br />
<br />
=== MeshTestsApp ===<!--T:9--><br />
Add test funtion<br />
<br />
=== TestSketcherApp ===<!--T:10--><br />
Add test funtion<br />
<br />
=== TestPartApp ===<!--T:11--><br />
Add test funtion<br />
<br />
=== TestPartDesignApp ===<!--T:12--><br />
Add test funtion<br />
<br />
=== Workbench ===<!--T:13--><br />
Add test funtion<br />
<br />
=== Menu ===<!--T:14--><br />
Add test funtion<br />
<br />
=== Menu.MenuDeleteCases ===<!--T:15--><br />
Add test funtion<br />
<br />
=== Menu.MenuCreateCases ===<!--T:16--><br />
Add test funtion<br />
<br />
<!--T:17--><br />
{{docnav|Debugging|Branding}}<br />
<br />
<!--T:18--><br />
[[Category:Developer Documentation]]<br />
<br />
</translate><br />
{{clear}}<br />
<languages/></div>Topcydehttps://wiki.freecad.org/index.php?title=Debugging&diff=124625Debugging2014-11-22T17:00:51Z<p>Topcyde: Clarified Generatting a backtrace for Linux and some styling corrections</p>
<hr />
<div><translate><br />
== Test First == <!--T:1--><br />
Before you go through the pain of debugging use the [[Testing|Test framework]] to check if the standard tests work properly. If they do not run complete there is possibly a broken installation.<br />
<br />
== Command Line == <!--T:2--><br />
The ''debugging'' of FreeCAD is supported by a few internal mechanisms. The command line version of FreeCAD provides some options for debugging support.<br />
<br />
These are the currently recognized options in FreeCAD 0.15:<br />
<br />
Generic options:<br />
-v [ --version ] Prints version string<br />
-h [ --help ] Prints help message<br />
-c [ --console ] Starts in console mode<br />
--response-file arg Can be specified with '@name', too<br />
<br />
Configuration:<br />
-l [ --write-log ] Writes a log file to:<br />
/home/graphos/.FreeCAD/FreeCAD.log<br />
--log-file arg Unlike to --write-log this allows to log to an <br />
arbitrary file<br />
-u [ --user-cfg ] arg User config file to load/save user settings<br />
-s [ --system-cfg ] arg Systen config file to load/save system settings<br />
-t [ --run-test ] arg Test level<br />
-M [ --module-path ] arg Additional module paths<br />
-P [ --python-path ] arg Additional python paths<br />
<br />
== Generating a Backtrace == <!--T:3--><br />
If you are running a version of FreeCAD from the bleeding edge of the development curve, it may "crash". You can help solve such problems by providing the developers with a "backtrace". To do this, you need to be running a "debug build" of the software. "Debug build" is a parameter that is set at compile time, so you'll either need to compile FreeCAD yourself, or obtain a pre-compiled "debug" version. <br />
<br />
=== For Linux === <!--T:4--><br />
Prerequisites: <br />
<br />
<!--T:5--><br />
* software package gdb installed<br />
* a debug build of FreeCAD<br />
* a FreeCAD model that causes a crash<br />
<br />
<!--T:6--><br />
Steps:<br />
Enter the following in your terminal window:<br />
</translate><br />
<pre><br />
$ cd FreeCAD/bin<br />
$ gdb FreeCAD<br />
</pre><br />
GNUdebugger will output some initializing information. The (gdb) shows GNUDebugger is running in the terminal, now input:<br />
<pre><br />
(gdb) handle SIG33 noprint nostop<br />
(gdb) run<br />
</pre><br />
<translate><br />
<!--T:7--><br />
FreeCAD will now start up. Perform the steps that cause FreeCAD to crash or freeze, then enter in the terminal window:<br />
<pre><br />
(gdb) bt<br />
</pre><br />
This will generate a lengthy listing of exactly what the program was doing when it crashed or froze. Include this with your problem report.<br />
<br />
== Python Debugging == <!--T:8--><br />
Here is an example of using winpdb inside FreeCAD:<br />
<br />
<!--T:9--><br />
# Run winpdb and set the password (e.g. test)<br />
# Create a Python file with this content<br />
</translate><br />
<syntaxhighlight><br />
import rpdb2<br />
rpdb2.start_embedded_debugger("test")<br />
import FreeCAD<br />
import Part<br />
import Draft<br />
print "hello"<br />
print "hello"<br />
import Draft<br />
points=[FreeCAD.Vector(-3.0,-1.0,0.0),FreeCAD.Vector(-2.0,0.0,0.0)]<br />
Draft.makeWire(points,closed=False,face=False,support=None)<br />
</syntaxhighlight><br />
<translate><br />
<!--T:10--><br />
# Start FreeCAD and load the above file into FreeCAD<br />
# Press F6 to execute it<br />
# Now FreeCAD will become unresponsive because the Python debugger is waiting<br />
# Switch to the Windpdb GUI and click on "Attach". After a few seconds an item "<Input>" appears where you have to double-click<br />
# Now the currently executed script appears in Winpdb.<br />
# Set a break at the last line and press F5<br />
# Now press F7 to step into the Python code of Draft.makeWire<br />
<br />
<!--T:11--><br />
{{Docnav|Module Creation|Testing}}<br />
<br />
<!--T:12--><br />
[[Category:Developer Documentation]]<br />
<br />
</translate><br />
{{clear}}<br />
<languages/></div>Topcydehttps://wiki.freecad.org/index.php?title=Testing&diff=124598Testing2014-11-22T15:40:50Z<p>Topcyde: Added list of Available Test apps</p>
<hr />
<div><translate><br />
== Introduction == <!--T:1--><br />
FreeCAD comes with an extensive testing framework. The testing bases on a set of Python scripts which are located in the test module.<br />
<br />
Here is the list of test apps as of 0.15 Git 4207:<br />
<br />
TestAPP.All<br />
<br />
BaseTests<br />
<br />
UnitTests<br />
<br />
Document<br />
<br />
UnicodeTests<br />
<br />
MeshTestsApp<br />
<br />
TestSketcherApp<br />
<br />
TestPartApp<br />
<br />
TestPartDesignApp<br />
<br />
Workbench<br />
<br />
Menu<br />
<br />
Menu.MenuDeleteCases<br />
<br />
Menu.MenuCreateCases<br />
<br />
<!--T:2--><br />
{{docnav|Debugging|Branding}}<br />
<br />
<!--T:3--><br />
[[Category:Developer Documentation]]<br />
<br />
</translate><br />
{{clear}}<br />
<languages/></div>Topcydehttps://wiki.freecad.org/index.php?title=Debugging&diff=124557Debugging2014-11-21T04:53:35Z<p>Topcyde: Corrected and updated commandline information</p>
<hr />
<div><translate><br />
== Test first == <!--T:1--><br />
Before you go through the pain of debugging use the test framework to check if the standard tests work properly. If not there is maybe a broken installation.<br />
<br />
== command line == <!--T:2--><br />
The ''debugging'' of FreeCAD is supported by a few internal mechanisms. The command line version of FreeCAD provides some options for debugging support.<br />
<br />
These are the currently recognized options in FreeCAD 0.15:<br />
<br />
Generic options:<br />
-v [ --version ] Prints version string<br />
-h [ --help ] Prints help message<br />
-c [ --console ] Starts in console mode<br />
--response-file arg Can be specified with '@name', too<br />
<br />
Configuration:<br />
-l [ --write-log ] Writes a log file to:<br />
/home/graphos/.FreeCAD/FreeCAD.log<br />
--log-file arg Unlike to --write-log this allows to log to an <br />
arbitrary file<br />
-u [ --user-cfg ] arg User config file to load/save user settings<br />
-s [ --system-cfg ] arg Systen config file to load/save system settings<br />
-t [ --run-test ] arg Test level<br />
-M [ --module-path ] arg Additional module paths<br />
-P [ --python-path ] arg Additional python paths<br />
<br />
== Generating a Backtrace == <!--T:3--><br />
If you are running a version of FreeCAD from the bleeding edge of the development curve, it may "crash". You can help solve such problems by providing the developers with a "backtrace". To do this, you need to be running a "debug build" of the software. "Debug build" is a parameter that is set at compile time, so you'll either need to compile FreeCAD yourself, or obtain a pre-compiled "debug" version. <br />
<br />
=== For Linux === <!--T:4--><br />
Prerequisites: <br />
<br />
<!--T:5--><br />
* software package gdb installed<br />
* a debug build of FreeCAD<br />
* a FreeCAD model that causes a crash<br />
<br />
<!--T:6--><br />
Steps:<br />
Enter the following in your terminal window:<br />
</translate><br />
<pre><br />
cd FreeCAD/bin<br />
gdb FreeCAD<br />
handle SIG33 noprint nostop<br />
run<br />
</pre><br />
<translate><br />
<!--T:7--><br />
FreeCAD will now start up. Perform the steps that cause FreeCAD to crash, then enter 'bt' in your terminal window. This will generate a lengthy listing of exactly what the program was doing when it crash. Include this with your problem report.<br />
<br />
== Python debugging == <!--T:8--><br />
Here is an example of using winpdb inside FreeCAD:<br />
<br />
<!--T:9--><br />
# Run winpdb and set the password (e.g. test)<br />
# Create a Python file with this content<br />
</translate><br />
<syntaxhighlight><br />
import rpdb2<br />
rpdb2.start_embedded_debugger("test")<br />
import FreeCAD<br />
import Part<br />
import Draft<br />
print "hello"<br />
print "hello"<br />
import Draft<br />
points=[FreeCAD.Vector(-3.0,-1.0,0.0),FreeCAD.Vector(-2.0,0.0,0.0)]<br />
Draft.makeWire(points,closed=False,face=False,support=None)<br />
</syntaxhighlight><br />
<translate><br />
<!--T:10--><br />
# Start FreeCAD and load the above file into FreeCAD<br />
# Press F6 to execute it<br />
# Now FreeCAD will become unresponsive because the Python debugger is waiting<br />
# Switch to the Windpdb GUI and click on "Attach". After a few seconds an item "<Input>" appears where you have to double-click<br />
# Now the currently executed script appears in Winpdb.<br />
# Set a break at the last line and press F5<br />
# Now press F7 to step into the Python code of Draft.makeWire<br />
<br />
<!--T:11--><br />
{{Docnav|Module Creation|Testing}}<br />
<br />
<!--T:12--><br />
[[Category:Developer Documentation]]<br />
<br />
</translate><br />
{{clear}}<br />
<languages/></div>Topcyde