tomlplusplus/toml-test
Andrea Pappacoda 36030cace8 build(meson): use system deps when avalable
When building tests, Meson will now look for system dependencies and use
them if found. Otherwise, it will check if the submodules are cloned and
create a dependency object wrapping the include path of each external
dependency (this breaks Meson's sandbox, but the previous approach did
too). This also allows passing actual dependencies to the various build
targets instead of include paths (a bit more idiomatic).

I've also made it possible to skip the tl-optional tests when the lib is
not found, so that it is still possible to run tests even from a
tarball (i.e. no git checkout)
2022-02-17 22:45:07 +02:00
..
meson.build build(meson): use system deps when avalable 2022-02-17 22:45:07 +02:00
README.md fixed inconsistent error messages for overlong ints/floats (closes #133) 2022-01-08 00:08:31 +02:00
tt_decoder.cpp fixed inline tables being mutable through table headers (closes #131) 2022-01-05 16:56:08 +02:00
tt_decoder.vcxproj fixed incorrect unicode scalar sequence transformations (#125) 2022-01-04 23:58:22 +02:00
tt_encoder.cpp fixed inline tables being mutable through table headers (closes #131) 2022-01-05 16:56:08 +02:00
tt_encoder.vcxproj fixed incorrect unicode scalar sequence transformations (#125) 2022-01-04 23:58:22 +02:00
tt.h build(meson): use system deps when avalable 2022-02-17 22:45:07 +02:00

Encoder and Decoder for toml-test

The contents of this directory relate to testing with the toml-test suite, not anything to do with running the library's unit-tests. For information about running the unit-tests see CONTRIBUTING.

All command snippets in this document assume the working directory is the toml++ repository root.


Prequisites

For this document to make sense, you will need to:

  1. Follow the installation instructions from the toml-test README to compile the toml-test runner
  2. Add toml-test as an alias or have it on the system PATH
  3. Clone the toml++ repository's nlohmann/json submodule:
git submodule update --init --depth 1 external/json
  1. Linux only: Install ninja and meson:
sudo apt update && sudo apt install -y locales python3 python3-pip ninja-build
sudo pip3 install meson

Building and Testing the Encoder and Decoder

Windows with Visual Studio

Open toml++.sln and build the two projects in the toml-test solution folder. They'll be compiled in some target-specific subfolder under /bin in the repo root. Then run toml-test against them:

toml-test ./bin/win64_vc143_Release_Application/tt_decoder.exe
toml-test ./bin/win64_vc143_Release_Application/tt_encoder.exe --encoder

Linux (and WSL)

# create the meson build target folder (first time only)
meson build_tt --buildtype=release -Dbuild_tt_encoder=true -Dbuild_tt_decoder=true -Dgenerate_cmake_config=false

# build and run
cd build_tt
ninja && toml-test ./toml-test/tt_decoder && toml-test ./toml-test/tt_encoder --encoder