mirror of
https://github.com/marzer/tomlplusplus.git
synced 2024-11-02 02:26:28 +00:00
51 lines
1.8 KiB
Markdown
51 lines
1.8 KiB
Markdown
|
# 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](../CONTRIBUTING.md)._
|
|||
|
|
|||
|
<br>
|
|||
|
|
|||
|
## Prequisites
|
|||
|
For this document to make sense, you will need to:
|
|||
|
1. Install some recent version of Go
|
|||
|
2. Follow the installation instructions from the [toml-test] README to compile the `toml-test` runner
|
|||
|
3. Add `toml-test` as an alias or have it on the system PATH
|
|||
|
4. Clone the toml++ repository's [nlohmann/json] submodule:
|
|||
|
```bash
|
|||
|
git submodule update --init --depth 1 external/json
|
|||
|
```
|
|||
|
5. **Linux only:** Install `ninja` and `meson`:
|
|||
|
```bash
|
|||
|
sudo apt update && sudo apt install -y locales python3 python3-pip ninja-build
|
|||
|
sudo pip3 install meson
|
|||
|
```
|
|||
|
|
|||
|
<br>
|
|||
|
|
|||
|
## Building and Testing the Encoder and Decoder
|
|||
|
> ℹ️ _Commands in this section assume the starting directory is the toml++ repository root directory._
|
|||
|
|
|||
|
### 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:
|
|||
|
```bash
|
|||
|
toml-test ./bin/win64_vc143_Release_Application/tt_decoder.exe
|
|||
|
toml-test ./bin/win64_vc143_Release_Application/tt_encoder.exe --encoder
|
|||
|
```
|
|||
|
|
|||
|
### Linux (and WSL)
|
|||
|
```bash
|
|||
|
# 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
|
|||
|
```
|
|||
|
|
|||
|
|
|||
|
|
|||
|
[toml-test]: https://github.com/BurntSushi/toml-test
|
|||
|
[CONTRIBUTING]: ../CONTRIBUTING.md
|
|||
|
[nlohmann/json]: https://github.com/nlohmann/json
|
|||
|
[meson]: https://mesonbuild.com/
|