This page describe how to write code with dependencies on TopRootCore and run unit test on these classes using the NetBeans IDE.


Install TRC following the instruction from https://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/TopRootCore
Install NetBeans using yum install netbeans.
Install cppUnit using yum install cppUnit and yum install cppUnitDev

Run NetBeans

You need to start NetBeans from command line so that you can setup your environment. Use the same setup created for TRC (should include setups for GCC, ROOT and TRC). This is essential to run your unit tests since cppUnit will look into the LD_LIBRARY_PATH to find the right libraries.

Setup you project dependencies

In NetBeans create a new C++ project.
In the properties of the project you will need to change several values:
-Change the compiler for c++ from /usr/bin/g++ to the one used to compile ROOT and TRC
-add the include dir for ROOT ($ROOTSYSDIR/include) and TRC ($ROOTCOREDIR/iinclude) in the additional includes in for your c++ compiler
-In the linker add the paths for the ROOT ($ROOTSYSDIR/lib) and TRC ($ROOTCOREDIR/lib) libraries
-in the linker add all libraries from TRC ($ROOTCOREDIR/lib) and some from ROOT (not core, matrix or postscrip). Adding them will give an error such as libTopMiniNtuple.so: undefined reference to `ROOT::RegisterModule()'

NetBeans provides a dropdown menu to select values such as architecture (32 or 64 bits) or C++ standard (C++11 or C++98. If they do not work or if you prefer something different, you can add your compilation option in the additional option field in the c++ compiler tab of the project properties.

In the Test File folder add the include path for the project you are going to test in the c++ compiler. This will fix not being able to see the class you are testing.

Major updates:
-- MicheleFaucciGiannelli - 26 Mar 2014

%RESPONSIBLE% MicheleFaucciGiannelli
%REVIEW% Never reviewed

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2014-04-08 - MicheleFaucciGiannelli
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback