Adds test target to CMake

Configure with tests enabled:
    cmake -DBUILD_TESTS=Yes ..

To run the test suite (after building) just type:
    make test

Signed-off-by: Luís Pereira <luis.artur.pereira@gmail.com>