unity-scope-click hacking guide
===============================

Getting unity-scope-click
-------------------------

To get the main development branch of unity-scope-click:

    $ bzr branch lp:unity-scope-click/devel


Getting dependencies
--------------------

To succesfully build the scope there are a few packages required:

    $ sudo apt-get build-dep unity-scope-click


Building the scope
------------------

This scope is built using cmake. Here's an example on how to build it:

    $ mkdir build
    $ cd build
    $ cmake ..
    $ make -j 8


Running the unit tests
----------------------

    $ make check

Or, if you want to run the tests under valgrind:

    $ make check-valgrind


Running the autopilot tests
---------------------------

    $ make test-click-scope-autopilot-fake-servers


Running the autopkgtest tests
-----------------------------

    $ adt-run --unbuilt-tree . -o /tmp/adt-clickscope \
      -U --apt-pocket proposed --- qemu ~/adt-vivid-amd64-cloud.img


Running the scope
-----------------

You will usually run the scope inside a unity8 session, but when developing
a good way to test it is with unity-scope-tool. Inside the build directory do:

    $ mkdir clickscope
    $ (cd clickscope;ln -s ../scope/click/libclickscope.so .; ln -s ../data/clickscope.ini .)
    $ U1_DEBUG=true unity-scope-tool clickscope/clickscope.ini


Running the coverage tests
--------------------------

To run the coverage tests you'll need to install the gcovr and lcov packages.
Then you need to compile with coverage enabled, like this:

    $ cmake .. -DCMAKE_BUILD_TYPE=coverage
    $ make
    $ make test
    $ make coverage


If you want the coverage report in pretty HTML, use:

    $ make coverage-html

The html will be left in the coveragereport directory.

Updating departments db
-----------------------
See tools/init-departments/README for details about how to re-create departments database
file found in data/departments.db.
