Commit graph

2 commits

Author SHA1 Message Date
Chris Kitching 527a69bb64
Install the test binary and test data. Fixes #241
The resulting install tree, when tests are enabled, looks like this:

```
.
├── cmake
│   ├── nlohmann_jsonConfig.cmake
│   ├── nlohmann_jsonConfigVersion.cmake
│   └── nlohmann_jsonTargets.cmake
├── include
│   └── nlohmann
│       └── json.hpp
└── test
    ├── bin
    │   └── json_unit
    └── data
        ├── json_nlohmann_tests
        │   ├── all_unicode.json
        │   └── bom.json
        ├── json.org
        │   ├── 1.json
        │   ├── ...
        ├── json_roundtrip
        │   ├── roundtrip01.json
        │   ├── roundtrip02.json
        │   └── ...
        ├── json_tests
        │   ├── fail10.json
        │   └── ...
        └── json_testsuite
            └── sample.json
```

It has the property that you can invoke the test binary from the
root of the install tree and the tests work correctly (you no
longer depend on the test binary being run inside the source
tree).

If tests are disabled, the entire `test/` subtree is omitted.
Notice how that yields exactly what you want for using this
library in other projects.

I do not believe I need to update travis due to this change, as the
evil Makefile continues to do in-tree builds. I expect I'll find
out soon enough.
2016-05-11 01:43:42 +01:00
Chris Kitching af76508fe7
Introduce structure to the test/ directory
This introduces a clear separation between test data and test
binaries. Test data is moved into test/data, and the test binaries
move into test/src. A new CMake script specific to building the
tests is introduced in /test to slightly clean up the toplevel
one.

As well as tidying things up, this makes the next step trivial...
2016-05-11 01:30:08 +01:00