removed git submodules to fix various tooling issues (closes #151)

- removed submodules in `external/`
- vendored `Catch2` and `nlohmann/json directly`
- updated conformance test generator to look outside the repo for test sources
This commit is contained in:
Mark Gillard 2022-05-01 10:35:21 +03:00
parent 1c09239fbd
commit e47ef8cfb2
33 changed files with 41572 additions and 312 deletions

2
.gitattributes vendored
View File

@ -63,3 +63,5 @@ meson.build text eol=lf encoding=UTF-8
*.psd binary
*.rc binary
*.xlsx binary
vendor/* linguist-vendored

View File

@ -52,7 +52,7 @@ jobs:
- name: Install dependencies
run: |
apt-get -y update
apt-get -y install --no-install-recommends ${{ matrix.compiler }} lld meson pkgconf git ca-certificates locales-all python3-pip catch2 nlohmann-json3-dev
apt-get -y install --no-install-recommends ${{ matrix.compiler }} lld meson pkgconf git ca-certificates locales-all python3-pip
- uses: actions/checkout@v2
@ -93,8 +93,6 @@ jobs:
pip3 install meson ninja
- uses: actions/checkout@v2
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
@ -158,4 +156,4 @@ jobs:
# build
tipi . --dont-upgrade --verbose -t linux-cxx17
./build/linux-cxx17/bin/simple_parser ../example.toml
./build/linux-cxx17/bin/simple_parser ../example.toml

21
.gitmodules vendored
View File

@ -1,21 +0,0 @@
[submodule "external/toml-test"]
path = external/toml-test
url = https://github.com/BurntSushi/toml-test.git
shallow = true
[submodule "external/toml-spec-tests"]
path = external/toml-spec-tests
url = https://github.com/iarna/toml-spec-tests.git
shallow = true
[submodule "external/tloptional"]
path = external/tloptional
url = https://github.com/TartanLlama/optional.git
shallow = true
[submodule "external/json"]
path = external/json
url = https://github.com/nlohmann/json.git
shallow = true
[submodule "external/Catch2"]
path = external/Catch2
url = https://github.com/catchorg/Catch2.git
branch = v2.x
shallow = true

View File

@ -1,7 +1,3 @@
{
"x": ["/external"],
"requires": {
"tipi-deps/Catch2@file://single_include": { "@": "v2.x" },
"nlohmann/json": { "@": "v3.10.5" }
}
"requires": {}
}

View File

@ -21,11 +21,7 @@ If you wish to submit a PR, please be aware that:
<br>
## Building and running the tests
Testing is done using [Catch2], included in the respository as a submodule under `extern/Catch2`.
The first time you want to begin testing you'll need to ensure submodules have been fetched:
```bash
git submodule update --init --depth 1 external/Catch2 external/tloptional
```
Testing is done using [Catch2], vendored in the respository at `vendor/catch.hpp`.
### Testing on Windows with Visual Studio

View File

@ -162,8 +162,8 @@ FetchContent_MakeAvailable(tomlplusplus)
git submodule add --depth 1 https://github.com/marzer/tomlplusplus.git tomlplusplus
git config -f .gitmodules submodule.tomlplusplus.shallow true
```
> &#xFE0F; The toml++ repository has some submodules of its own, but **they are only used for testing**!
> You should not use the `--recursive` option for regular library consumption.
> &#xFE0F; The toml++ repository has some submodules of its own, but **they are only used for testing**!
> You should **not** use the `--recursive` option for regular library consumption.
### Other environments and package managers

View File

@ -521,8 +521,8 @@ FetchContent_MakeAvailable(tomlplusplus)
git submodule add --depth 1 https://github.com/marzer/tomlplusplus.git tomlplusplus
git config -f .gitmodules submodule.tomlplusplus.shallow true
\ebash
\note The toml++ repository has some submodules of its own, but **they are only used for testing**! You should not use
the `--recursive` option for regular library consumption.
\attention The toml++ repository has some submodules of its own, but **they are only used for testing**!
You should **not** use the `--recursive` option for regular library consumption.
@ -535,7 +535,7 @@ integration you'd like to see and have the technical know-how to make it happen,
\subsection mainpage-adding-lib-python Special mention: Python
There exists a python wrapper library built around toml++ called
\github{bobfang1992/pytomlpp, pytomlpp} which is, at the time of writing, the one of only two natively-compiled
\github{bobfang1992/pytomlpp, pytomlpp} which is, at the time of writing, one of only two natively-compiled
TOML libraries available for python, and thus one of the fastest options available:
\out
@ -554,8 +554,8 @@ Install it using `pip`:
pip install pytomlpp
\ebash
Note that I'm not the owner of that project so if you wish to report a bug relating to the python
implementation, please do so at their repository, not on the main toml++ one.
Note that I'm not the owner of that project, so if you wish to report a bug relating to the python
implementation please do so at their repository, not on the main toml++ one.

1
external/Catch2 vendored

@ -1 +0,0 @@
Subproject commit d71b4617e9935f8589870af211f5b7552d743654

1
external/json vendored

@ -1 +0,0 @@
Subproject commit fcc36f99ba1afc7baebe24e0c7429d2039d32d99

1
external/tloptional vendored

@ -1 +0,0 @@
Subproject commit c28fcf74d207fc667c4ed3dbae4c251ea551c8c1

@ -1 +0,0 @@
Subproject commit 1880b1a17849f6ad49a7a5e87d6a3ac3963172da

1
external/toml-test vendored

@ -1 +0,0 @@
Subproject commit 10cdc99d96fbf1350a8891a9d93295fcc85aa694

View File

@ -567,7 +567,7 @@ TOML_NAMESPACE_START
private:
/// \cond
template <typename Func>
static constexpr bool visit_is_nothrow = noexcept(std::declval<viewed_type*>()->visit(std::declval<Func&&>()));
static constexpr bool visit_is_nothrow = noexcept(std::declval<viewed_type*>()->visit(std::declval<Func>()));
/// \endcond
public:

View File

@ -404,9 +404,10 @@
#endif
// dll/shared lib function exports (legacy - TOML_API was the old name for this setting)
#if !defined(TOML_EXPORTED_MEMBER_FUNCTION) \
#if !defined(TOML_EXPORTED_MEMBER_FUNCTION) \
&& !defined(TOML_EXPORTED_STATIC_FUNCTION) \
&& !defined(TOML_EXPORTED_FREE_FUNCTION) \
&& !defined(TOML_EXPORTED_CLASS) \
&& defined(TOML_API)
#define TOML_EXPORTED_MEMBER_FUNCTION TOML_API
#define TOML_EXPORTED_STATIC_FUNCTION TOML_API

View File

@ -4,7 +4,6 @@ project(
version: '3.1.0',
meson_version: '>=0.54.0',
license: 'MIT',
subproject_dir: 'external',
default_options: [ # https://mesonbuild.com/Builtin-options.html
# core options
'buildtype=release',

View File

@ -8,10 +8,6 @@
#define TOML_IMPLEMENTATION
#endif
#if USE_TARTANLLAMA_OPTIONAL
#include "lib_tloptional.h"
#endif
#if USE_SINGLE_HEADER
#include "../toml.hpp"
#else

View File

@ -22,13 +22,7 @@
#pragma warning(disable : 5105)
#endif
#if __has_include(<Catch2/single_include/catch2/catch.hpp>)
#include <Catch2/single_include/catch2/catch.hpp>
#elif __has_include(<catch2/catch.hpp>)
#include <catch2/catch.hpp>
#else
#error Catch2 is missing! You probably need to fetch submodules ("git submodule update --init --depth 1 external/Catch2")
#endif
#include "../vendor/catch.hpp"
#ifdef __clang__
#pragma clang diagnostic pop

View File

@ -1,30 +0,0 @@
// This file is a part of toml++ and is subject to the the terms of the MIT license.
// Copyright (c) Mark Gillard <mark.gillard@outlook.com.au>
// See https://github.com/marzer/tomlplusplus/blob/master/LICENSE for the full license text.
// SPDX-License-Identifier: MIT
#pragma once
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wpadded"
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
#if __has_include(<tloptional/include/tl/optional.hpp>)
#include <tloptional/include/tl/optional.hpp>
#elif __has_include(<tl/optional.hpp>)
#include <tl/optional.hpp>
#else
#error TartanLlama/optional is missing! You probably need to fetch submodules ("git submodule update --init --depth 1 external/tloptional")
#endif
#ifdef __clang__
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

View File

@ -33,29 +33,6 @@ test_deps = [tomlplusplus_dep]
fs = import('fs')
catch2_dep = dependency('catch2', required: false)
if catch2_dep.found()
test_deps += catch2_dep
elif fs.exists('..'/'external'/'Catch2'/'single_include')
catch2_dep = declare_dependency(include_directories: '..'/'external'/'Catch2'/'single_include')
test_deps += catch2_dep
else
error('Catch2 is missing! You probably need to fetch submodules ("git submodule update --init --depth 1 external/Catch2"')
endif
has_tl_optional = false
tl_optional_dep = dependency('tl-optional', required: false)
if tl_optional_dep.found()
test_deps += tl_optional_dep
has_tl_optional = true
elif fs.exists('..'/'external'/'tloptional'/'include')
tl_optional_dep = declare_dependency(include_directories: '..'/'external'/'tloptional'/'include')
test_deps += tl_optional_dep
has_tl_optional = true
else
warning('tl-optional not found, skipping its tests')
endif
#######################################################################################################################
# fast math check
#######################################################################################################################
@ -153,14 +130,6 @@ foreach cpp20 : cpp20_modes
and not get_option('compile_library')
)
# use tl::optional to test that the TOML_OPTIONAL_TYPE config option works as advertised
tl_optional = (
test_counter % 2 == 1
and has_tl_optional
and not get_option('compile_library')
and exceptions # requires exceptions in its API
)
# use asan in the tests
address_sanitizer = (
get_option('asan_tests')
@ -241,11 +210,6 @@ foreach cpp20 : cpp20_modes
test_args += '-DUSE_SINGLE_HEADER=1'
endif
if tl_optional
test_args += '-DUSE_TARTANLLAMA_OPTIONAL=1'
test_name = test_name + '_tlopt'
endif
test_executables += [[
test_name,
executable(

View File

@ -22,14 +22,6 @@
#define LEAK_TESTS 0
#endif
// use tl::optional?
#if defined(USE_TARTANLLAMA_OPTIONAL) && USE_TARTANLLAMA_OPTIONAL
#define TOML_OPTIONAL_TYPE tl::optional
#else
#undef USE_TARTANLLAMA_OPTIONAL
#define USE_TARTANLLAMA_OPTIONAL 0
#endif
// catch2 config
#define CATCH_CONFIG_CPP11_TO_STRING
#define CATCH_CONFIG_CPP17_OPTIONAL

View File

@ -6,10 +6,6 @@
#pragma once
#include "settings.h"
#if USE_TARTANLLAMA_OPTIONAL
#include "lib_tloptional.h"
#endif
#if USE_SINGLE_HEADER
#include "../toml.hpp"
#else

View File

@ -1,126 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{202DCF23-B4E4-5FB9-AFA8-CC9A718067FF}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props"
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="../../toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WarningLevel>EnableAllWarnings</WarningLevel>
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings> <!-- conditional expr is constant -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings> <!-- structure was padded due to alignment specifier -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings> <!-- relative include path contains '..' -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings> <!-- unreferenced local function removed -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings> <!-- unreferenced inline function has been removed -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings> <!-- 'noexcept' used with no exception handling mode specified -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings> <!-- constructor is not implicitly called -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings> <!-- default constructor was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings> <!-- copy constructor was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings> <!-- assignment operator was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings> <!-- function not inlined -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings> <!-- function selected for automatic expansion -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings> <!-- storing 32-bit float result in memory -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings> <!-- N bytes padding added -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in operator[] -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings> <!-- compiler may not enforce ltr eval in initializer list -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings> <!-- reinterpret_cast used between related classes -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings> <!-- move constructor was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings> <!-- move assignment operator was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings> <!-- potentially throwing function passed to 'extern "C"' -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings> <!-- Compiler will insert Spectre mitigation -->
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\at_path.cpp" />
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\conformance_iarna_valid.cpp" />
<ClCompile Include="..\for_each.cpp" />
<ClCompile Include="..\formatters.cpp" />
<ClCompile Include="..\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\main.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\manipulating_arrays.cpp" />
<ClCompile Include="..\manipulating_tables.cpp" />
<ClCompile Include="..\manipulating_parse_result.cpp" />
<ClCompile Include="..\manipulating_values.cpp" />
<ClCompile Include="..\parsing_arrays.cpp" />
<ClCompile Include="..\parsing_booleans.cpp" />
<ClCompile Include="..\parsing_comments.cpp" />
<ClCompile Include="..\parsing_dates_and_times.cpp" />
<ClCompile Include="..\parsing_floats.cpp" />
<ClCompile Include="..\parsing_integers.cpp" />
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\parsing_spec_example.cpp" />
<ClCompile Include="..\parsing_strings.cpp" />
<ClCompile Include="..\parsing_tables.cpp" />
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\visit.cpp" />
<ClCompile Include="..\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="..\..\toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\leakproof.h" />
<ClInclude Include="..\lib_catch2.h" />
<ClInclude Include="..\lib_tloptional.h" />
<ClInclude Include="..\settings.h" />
<ClInclude Include="..\tests.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\cpp.hint" />
<None Include="..\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{202DCF23-B4E4-5FB9-AFA8-CC9A718067FF}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<PreferredToolArchitecture>x64</PreferredToolArchitecture>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<Import Project="../../toml++.props" />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>..\tests;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Sync</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>tests.h</PrecompiledHeaderFile>
<PreprocessorDefinitions>TOML_ENABLE_UNRELEASED_FEATURES=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>LEAK_TESTS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'=='false'">SHOULD_HAVE_EXCEPTIONS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'%(ExceptionHandling)'!='false'">SHOULD_HAVE_EXCEPTIONS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<LanguageStandard>stdcpp17</LanguageStandard>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<WarningLevel>EnableAllWarnings</WarningLevel>
<DisableSpecificWarnings>%(DisableSpecificWarnings);4127</DisableSpecificWarnings>
<!-- conditional expr is constant -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4324</DisableSpecificWarnings>
<!-- structure was padded due to alignment specifier -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4464</DisableSpecificWarnings>
<!-- relative include path contains '..' -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4505</DisableSpecificWarnings>
<!-- unreferenced local function removed -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4514</DisableSpecificWarnings>
<!-- unreferenced inline function has been removed -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4577</DisableSpecificWarnings>
<!-- 'noexcept' used with no exception handling mode specified -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4582</DisableSpecificWarnings>
<!-- constructor is not implicitly called -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4623</DisableSpecificWarnings>
<!-- default constructor was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4625</DisableSpecificWarnings>
<!-- copy constructor was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4626</DisableSpecificWarnings>
<!-- assignment operator was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4710</DisableSpecificWarnings>
<!-- function not inlined -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4711</DisableSpecificWarnings>
<!-- function selected for automatic expansion -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4738</DisableSpecificWarnings>
<!-- storing 32-bit float result in memory -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4820</DisableSpecificWarnings>
<!-- N bytes padding added -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4866</DisableSpecificWarnings>
<!-- compiler may not enforce ltr eval in operator[] -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4868</DisableSpecificWarnings>
<!-- compiler may not enforce ltr eval in initializer list -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);4946</DisableSpecificWarnings>
<!-- reinterpret_cast used between related classes -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5026</DisableSpecificWarnings>
<!-- move constructor was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5027</DisableSpecificWarnings>
<!-- move assignment operator was implicitly defined as deleted -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5039</DisableSpecificWarnings>
<!-- potentially throwing function passed to 'extern "C"' -->
<DisableSpecificWarnings>%(DisableSpecificWarnings);5045</DisableSpecificWarnings>
<!-- Compiler will insert Spectre mitigation -->
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup>
<LocalDebuggerWorkingDirectory>$(ProjectDir)..\</LocalDebuggerWorkingDirectory>
</PropertyGroup>
<ItemGroup>
<ClCompile Include="..\at_path.cpp" />
<ClCompile Include="..\conformance_burntsushi_invalid.cpp" />
<ClCompile Include="..\conformance_burntsushi_valid.cpp" />
<ClCompile Include="..\conformance_iarna_invalid.cpp" />
<ClCompile Include="..\conformance_iarna_valid.cpp" />
<ClCompile Include="..\for_each.cpp" />
<ClCompile Include="..\formatters.cpp" />
<ClCompile Include="..\impl_toml.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\main.cpp">
<PrecompiledHeader>NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\manipulating_arrays.cpp" />
<ClCompile Include="..\manipulating_tables.cpp" />
<ClCompile Include="..\manipulating_parse_result.cpp" />
<ClCompile Include="..\manipulating_values.cpp" />
<ClCompile Include="..\parsing_arrays.cpp" />
<ClCompile Include="..\parsing_booleans.cpp" />
<ClCompile Include="..\parsing_comments.cpp" />
<ClCompile Include="..\parsing_dates_and_times.cpp" />
<ClCompile Include="..\parsing_floats.cpp" />
<ClCompile Include="..\parsing_integers.cpp" />
<ClCompile Include="..\parsing_key_value_pairs.cpp" />
<ClCompile Include="..\parsing_spec_example.cpp" />
<ClCompile Include="..\parsing_strings.cpp" />
<ClCompile Include="..\parsing_tables.cpp" />
<ClCompile Include="..\tests.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\user_feedback.cpp" />
<ClCompile Include="..\using_iterators.cpp" />
<ClCompile Include="..\visit.cpp" />
<ClCompile Include="..\windows_compat.cpp" />
</ItemGroup>
<ItemGroup>
<Natvis Include="..\..\toml++.natvis" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\leakproof.h" />
<ClInclude Include="..\lib_catch2.h" />
<ClInclude Include="..\settings.h" />
<ClInclude Include="..\tests.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\cpp.hint" />
<None Include="..\meson.build" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -60,7 +60,7 @@
<PropertyGroup>
<OutDir>$(TomlOutRoot)bin\win$(PlatformArchitecture)_vc$(PlatformToolsetVersion)_$(Configuration)_$(ConfigurationType)\</OutDir>
<IntDir>$(TomlOutRoot)build\$(ProjectName)_win$(PlatformArchitecture)_vc$(PlatformToolsetVersion)_$(Configuration)\</IntDir>
<IncludePath>$(TomlRepoRoot)include;$(TomlRepoRoot)external;$(IncludePath)</IncludePath>
<IncludePath>$(TomlRepoRoot)include;$(IncludePath)</IncludePath>
</PropertyGroup>
<!-- :: base compiler settings -->
@ -197,4 +197,3 @@
</Target>
</Project>

View File

@ -93,8 +93,12 @@
<None Include=".github\workflows\ci.yaml" />
<None Include=".github\workflows\gh-pages.yaml" />
<None Include=".gitignore" />
<None Include=".gitmodules" />
<None Include=".runsettings" />
<None Include=".tipi\deps" />
<None Include="CHANGELOG.md" />
<None Include="cmake\tomlplusplusConfig.cmake.meson.in" />
<None Include="cmake\tomlplusplusConfigVersion.cmake.meson.in" />
<None Include="CODE_OF_CONDUCT.md" />
<None Include="CONTRIBUTING.md" />
<None Include="include\meson.build" />
@ -105,7 +109,6 @@
<None Include="README.md" />
<None Include="cmake\install-rules.cmake" />
<None Include="cmake\project-is-top-level.cmake" />
<None Include="cmake\tomlplusplus.cmake.in" />
<None Include="cmake\tomlplusplusConfig.cmake" />
<None Include="cmake\variables.cmake" />
<None Include="cpp.hint" />
@ -121,6 +124,7 @@
<None Include="tools\generate_single_header.py" />
<None Include="tools\generate_windows_test_targets.py" />
<None Include="tools\utils.py" />
<None Include="vendor\README.md" />
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />

View File

@ -181,9 +181,6 @@
<None Include="cmake\variables.cmake">
<Filter>cmake</Filter>
</None>
<None Include="cmake\tomlplusplus.cmake.in">
<Filter>cmake</Filter>
</None>
<None Include=".clang-format" />
<None Include=".editorconfig" />
<None Include="tools\clang_format.bat">
@ -229,6 +226,19 @@
<None Include=".github\workflows\gh-pages.yaml">
<Filter>.github\workflows</Filter>
</None>
<None Include="cmake\tomlplusplusConfig.cmake.meson.in">
<Filter>cmake</Filter>
</None>
<None Include="cmake\tomlplusplusConfigVersion.cmake.meson.in">
<Filter>cmake</Filter>
</None>
<None Include=".tipi\deps">
<Filter>.tipi</Filter>
</None>
<None Include=".gitmodules" />
<None Include="vendor\README.md">
<Filter>vendor</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Filter Include=".circleci">
@ -261,6 +271,12 @@
<Filter Include=".github\workflows">
<UniqueIdentifier>{f9731b43-6c33-4209-9e53-e65af54f80c4}</UniqueIdentifier>
</Filter>
<Filter Include=".tipi">
<UniqueIdentifier>{f34bec4a-27c1-478d-bdff-2f672cb564db}</UniqueIdentifier>
</Filter>
<Filter Include="vendor">
<UniqueIdentifier>{d6d69e89-b238-4dee-9f6a-68b755154539}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Natvis Include="toml++.natvis" />

View File

@ -11,11 +11,7 @@
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:
```bash
git submodule update --init --depth 1 external/json
```
4. **Linux only:** Install `ninja` and `meson`:
3. **Linux only:** Install `ninja` and `meson`:
```bash
sudo apt update && sudo apt install -y python3 python3-pip ninja-build
sudo pip3 install meson
@ -46,5 +42,4 @@ ninja && toml-test ./toml-test/tt_decoder && toml-test ./toml-test/tt_encoder --
[toml-test]: https://github.com/BurntSushi/toml-test
[CONTRIBUTING]: ../CONTRIBUTING.md
[nlohmann/json]: https://github.com/nlohmann/json
[meson]: https://mesonbuild.com/

View File

@ -1,6 +1,5 @@
tt_deps = [
tomlplusplus_dep,
dependency('nlohmann_json', fallback: ['json', 'nlohmann_json_dep'])
tomlplusplus_dep
]
if get_option('build_tt_encoder')

View File

@ -15,13 +15,8 @@
#pragma warning(push, 0)
#endif
#if __has_include(<json/single_include/nlohmann/json.hpp>)
#include <json/single_include/nlohmann/json.hpp>
#elif __has_include(<nlohmann/json.hpp>)
#include <nlohmann/json.hpp>
#else
#error nlohmann/json is missing! You probably need to fetch submodules ("git submodule update --init --depth 1 external/json")
#endif
#define JSON_HAS_FILESYSTEM 0
#include "../vendor/json.hpp"
#include <string>
#include <string_view>

View File

@ -419,9 +419,10 @@
#endif
// dll/shared lib function exports (legacy - TOML_API was the old name for this setting)
#if !defined(TOML_EXPORTED_MEMBER_FUNCTION) \
#if !defined(TOML_EXPORTED_MEMBER_FUNCTION) \
&& !defined(TOML_EXPORTED_STATIC_FUNCTION) \
&& !defined(TOML_EXPORTED_FREE_FUNCTION) \
&& !defined(TOML_EXPORTED_CLASS) \
&& defined(TOML_API)
#define TOML_EXPORTED_MEMBER_FUNCTION TOML_API
#define TOML_EXPORTED_STATIC_FUNCTION TOML_API
@ -3530,7 +3531,7 @@ TOML_NAMESPACE_START
private:
template <typename Func>
static constexpr bool visit_is_nothrow = noexcept(std::declval<viewed_type*>()->visit(std::declval<Func&&>()));
static constexpr bool visit_is_nothrow = noexcept(std::declval<viewed_type*>()->visit(std::declval<Func>()));
public:

View File

@ -438,8 +438,30 @@ def add_condition(tests, condition, names):
def load_valid_inputs(tests, extern_root):
tests['valid']['burntsushi'] = load_tests(Path(extern_root, 'toml-test', 'tests', 'valid'), True, (
def find_tests_dir(*relative_path):
paths = (
(Path.cwd(),),
('.',),
(utils.entry_script_dir(), '..', '..') # side-by-side with toml_++ repo folder
)
for p in paths:
try:
path = Path(*p, *relative_path).resolve()
if path.exists() and path.is_dir():
return path
except:
pass
return None
def load_burnsushi_tests(tests):
root_dir = find_tests_dir('toml-test', 'tests')
if root_dir is None:
raise Exception(r'could not find burntsushi/toml-test')
tests['valid']['burntsushi'] = load_tests(Path(root_dir, 'valid'), True, (
# broken by the json reader
'key-alphanum',
))
@ -450,7 +472,30 @@ def load_valid_inputs(tests, extern_root):
'string-escape-esc', # \e in strings
))
tests['valid']['iarna'] = load_tests(Path(extern_root, 'toml-spec-tests', 'values'), True, (
tests['invalid']['burntsushi'] = load_tests(Path(root_dir, 'invalid'), False)
add_condition(tests['invalid']['burntsushi'], '!TOML_LANG_UNRELEASED', (
'datetime-no-secs',
re.compile(r'inline-table-linebreak-.*'),
'inline-table-trailing-comma',
'key-special-character',
'multi-line-inline-table',
'string-basic-byte-escapes',
))
def load_iarna_tests(tests):
root_dir = find_tests_dir('toml-spec-tests')
if root_dir is None:
raise Exception(r'could not find iarni/toml-spec-tests')
tests['invalid']['iarna'] = load_tests(Path(root_dir, 'errors'), False)
add_condition(tests['invalid']['iarna'], '!TOML_LANG_UNRELEASED', (
'inline-table-trailing-comma',
))
tests['valid']['iarna'] = load_tests(Path(root_dir, 'values'), True, (
# these are stress-tests for 'large' datasets. I test these separately. Having them inline in C++ code is insane.
'qa-array-inline-1000',
'qa-array-inline-nested-1000',
@ -470,24 +515,6 @@ def load_valid_inputs(tests, extern_root):
def load_invalid_inputs(tests, extern_root):
tests['invalid']['burntsushi'] = load_tests(Path(extern_root, 'toml-test', 'tests', 'invalid'), False)
add_condition(tests['invalid']['burntsushi'], '!TOML_LANG_UNRELEASED', (
'datetime-no-secs',
re.compile(r'inline-table-linebreak-.*'),
'inline-table-trailing-comma',
'key-special-character',
'multi-line-inline-table',
'string-basic-byte-escapes',
))
tests['invalid']['iarna'] = load_tests(Path(extern_root, 'toml-spec-tests', 'errors'), False)
add_condition(tests['invalid']['iarna'], '!TOML_LANG_UNRELEASED', (
'inline-table-trailing-comma',
))
def write_test_file(name, all_tests):
for test in all_tests:
@ -586,12 +613,9 @@ def write_test_file(name, all_tests):
def main():
extern_root = Path(utils.entry_script_dir(), '..', 'external').resolve()
utils.assert_existing_directory(extern_root)
assert extern_root.exists()
all_tests = { 'valid': dict(), 'invalid': dict() }
load_valid_inputs(all_tests, extern_root)
load_invalid_inputs(all_tests, extern_root)
load_burnsushi_tests(all_tests)
load_iarna_tests(all_tests)
for validity, sources in all_tests.items():
for source, tests in sources.items():
write_test_file('{}/{}'.format(source, validity), tests )

8
vendor/README.md vendored Normal file
View File

@ -0,0 +1,8 @@
# Vendored dependencies
The code files in this directory are third-party 'vendor' dependencies used by the various test applications.
&#xFE0F; They are **not** required for regular use of toml++. ⚠&#xFE0F;
&#xFE0F; They are not **not** `#included` anywhere in toml++. ⚠&#xFE0F;

17970
vendor/catch.hpp vendored Normal file

File diff suppressed because it is too large Load Diff

23352
vendor/json.hpp vendored Normal file

File diff suppressed because it is too large Load Diff