Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Setting up CLION with testing support

Thomas Braun edited this page Nov 2, 2020 · 1 revision

Set up development environment

In this section we will guide you through setting up development environment as this is essential for major contributions. We use CLion to develop cppTango therefore all the screenshots present it and obviously configuration steps may vary in case of other IDE.

Set up cppTango project

This one is quite simple: clone this repository; open CLion and point it CMakeLists.txt in the root folder of the project:

CLion

CLion will automatically run CMake: see 1

CMake build files will be stored under cmake-build-debug folder (2)

Once CLion finishes with CMake a bunch of runnable targets will appear, see 3. TIP start typing to filter the targets.

Start tango docker containers

cppTango shipped with start-tango target. It starts Tango docker containers and runs conf_devtest which is a program that populates Tango DB. Typical output looks like this:

start_tango_messages

NOTE for the first time CLion will compile everything and the actual output will be much longer

conf_devtest requires the following arguments:

DevTest/test
test/debian8/10
test/debian8/11
test/debian8/12
debian8_alias
debian8_attr_alias
test/fwd_debian8/10
test2/debian8/20

Success output from conf_devtest:

start_tango_conf_devtest

Now you have fully functional Tango environment running in the docker containers (TANGO_HOST=172.17.0.3:10000). To explore, for instance Tango DB, use Jive

Running single test

To run single test it must be first set up properly. Run -> Edit Configurations... ->

test_setup

For cxx tests the program arguments must be

--device1=test/debian8/10 --device2=test/debian8/11 --device3=test/debian8/12 --device20=test2/debian8/20 --fwd_device=test/fwd_debian8/10 --loop=1 --fulldsname=DevTest/test --serverhost=<YOUR_HOST> --clienthost=<YOUR_HOST> --serverversion=5 --docurl=http://www.tango-controls.org --devtype=TestDevice --dbserver=sys/database/2 --outpath=/tmp/ --refpath=<YOUR_PATH_TO_CPP_TANGO>/cppTango/test/cpp_test_suite/new_tests/out --loglevel=0 --dsloglevel=5 --suiteloop=1 --devicealias=debian8_alias --attributealias=debian8_attr_alias --verbose=true

Replace --serverhost=<YOUR_HOST>, --clienthost=<YOUR_HOST> and --refpath=<YOUR_PATH_TO_CPP_TANGO> the rest is the same.

To run old_test (cppTango/test/cpp_test_suite/old_tests) most of the time you just need to provide one argument (test device) and TANGO_HOST:

test_setup_old

NOTE environment variables can be copy-n-pasted using corresponding buttons

TIP you can define default configuration, for instance TANGO_HOST:

test_setup_default

Stop tango containers

To stop Tango docker containers run stop-tango. Typical output:

stop_tango

NOTE red popup box indicates that there was no executable selected for this target. This is perfectly fine in this case.