This adds support for http://coveralls.io/ to the cmake project. This can then be run via a new Travis job, which uploads json containing the coverage data to the website.
To use this, please login usin github at http://coveralls.io/ and enable the Jansson project. You can then get a nice percentage badge for code coverage after each Travis buid. Coveralls will also comment on pull request with coverage info.
To test and run it locally do:
```bash
$ mkdir build && cd build
$ cmake -DJANSSON_COVERALLS=ON -DCMAKE_BUILD_TYPE=Debug ..
$ cmake --build . # $ make
$ cmake --build . --target coveralls # $ make coveralls
```
There is also another script that generates a local HTML page using lcov CodeCoverage.cmake which can be run using
```bash
$ make coverage
```
The required depdencies to run this are:
gcov
curl
lcov (is needed for the normal CodeCoverage script)
The valgrind tests where not run on the suites.
And valgrind was always returning 0 so set an explicit exit code on exit. I also had forgotten to change the name of TEST_WITH_VALGRIND to JANSSON_TEST_WITH_VALGRIND so that the tests would never use valgrind.
This is because it's really easy to get a name collission if compiling
Jansson as a subproject in a larger CMake project. If one project includes
several subprojects each having their own config.h, this will cause the
wrong file to be loaded.
This will simplify linking against the lib, both from the build-tree and
install-tree from other CMake projects.
CMakes find_package command uses these configs to locate the exported
targets for the library.
* Also changed so that all CMake options for the project are prepended
with JANSSON_ so that there is no ambiguity when including this as a
subdirectory in another CMake project.
- Also added better FindSphinx support so that we can detect the version and not have a fatal error if it's too old.
- Added support for building latex documentation with -DBUILD_LATEX. Off by default.
- Added suppor for building man pages with -DBUILD_MAN. On by default (unless sphins is too old to support it).
The output dir is different anyway, and this just makes it more
complicated to build projects that link to this, because they need
different link rules based on the build type.
- Encourage actually using the unit tests by compiling them by default.
Set the WITHOUT_TESTS variable to build without instead...
- Changed comments to keep within 80 characters.
- Don't have a hard coded path for valgrind, simply assuem it's in the path instead (an OSX ports install puts it in /opt/local/bin for instance).
- Fixed building the shared lib.
- Moved everything to one CMakeLists.txt
- Added support for the json_process test suites (instead of just the API
tests).
- Changed to use the modified json_process version that does away with the
environment variables (originally written by DanielT).
- Had to exclude "test_memory_funcs" on MSVC, since void pointer
arithmetics are not allowed as it is done in secure_malloc and
secure_free.
- Had to add a check for "ssize_t". This is not available on Windows and
maybe on some other platforms (used in test_pack.c)
- Result from running ctest (The failure seems unrelated to CMake, it's
just that the expected result is in a different order):
99% tests passed, 1 tests failed out of 121
Total Test time (real) = 1.31 sec
The following tests FAILED:
24 - valid__complex-array (Failed)
Added multiple CMake-related files to project.
Supports building the library and the tests.
See CMakeLists.txt for notes on how it works.
I had to adjust 3 existing files in order to disable some configuration
that should be taken care of by cmake/automake anyway.
I also added jansson.def from a future jansson version,
to test cmake's support for .def files (which works fine).