Saturday, 4 August 2012

Help us test FreeCAD!

Last Updated: 06.04.2014

We need testers to give useful information back to us FreeCAD developers.  We know there are missing features and we wish we could grow additional limbs to increase productivity. Nevertheless, we want to produce something hight quality and when FreeCAD crashes we want to fix it. 

The more descriptive the information you can provide, the more easier and faster we can fix it. So here's a few hints to help test FreeCAD.

How to test a branch using GIT:

FreeCAD is now using GIT which is allowing more rapid development of features from contributors FreeCAD has mainline branches on source forge and from individuals. Firstly to test a feature, find the branch you want to test which can be found on the forums.

First ensure that you have git installed and also the correct development libraries - help is available on the FreeCAD wiki and Forum, but feel free to ask on the IRC channel #freecad

These will be 

Checking out a branch

Developers use github to track and share development more easily. Various modules I am developing can be found here on Github



When you've found the git address (at the top) in your console or terminal application create a testing directory and change into the directory.

mkdir test && cd test

The run "git clone http:://repositoryaddress" like the below to clone this repository into your testing directory.
git clone https://github.com/mrlukeparry/FreeCAD_sf_master.git

It should look like below. Cloning FreeCAD shouldn't take too long (it's about a 70mb download).


When it's finished it will create a free-cad directory. Change to this and you will be in the source directory. To switch to a specific branch (e.g. render) run the command below:

git checkout -b render

Now you can begin compiling!

Compile with Debug Information:

Compiling with debug information is more useful to report errors and doesn't cause too much slowdown. It is first a good idea to build outside the source directory. So make a new build directory like...

mkdir Build && cd Build

In the build directory we configure to build a debug version and we need to append "../" or equivalent to point to the source directory like
cmake - DCMAKE_BUILD_TYPE=Debug ../
Now you can run make and let it build.
make
If you have multiple CPU cores or have hyperthreading available, take advantage of this and build even faster by creating parallel build jobs. Add the argument -jN where N is the number of cores
make -j4

FreeCAD will begin compiling: A full compile of FreeCAD for me takes around 20-30 minutes.

Testing: when something goes wrong

If you find a problem. First try and find a definite way to replicate it. Otherwise it's very difficult to isolate the behavior. Once its repeatable, you can run a debugger like so: Browse to the bin directory and run the command from terminal / console:
gdb FreeCAD
This will use the GNU debugger and load the program symbols and present to you a console. Next run the command to disable real time messages
handle SIG33 noprint nostop
Then type 'run' to start debugging FreeCAD. 
run
Replicate the crash and when it becomes unresponsive, back in the debugger you can run 
stacktrace
Use a pastebin site and then give this back to the developers to figure out with additional information on IRC or the forums. 

Additionally take a look my valgrind post to help further.