2020-01-04 14:21:38 +00:00
|
|
|
test_sources = [
|
|
|
|
'main.cpp',
|
|
|
|
'parsing_arrays.cpp',
|
|
|
|
'parsing_booleans.cpp',
|
|
|
|
'parsing_comments.cpp',
|
|
|
|
'parsing_dates_and_times.cpp',
|
|
|
|
'parsing_floats.cpp',
|
|
|
|
'parsing_integers.cpp',
|
|
|
|
'parsing_key_value_pairs.cpp',
|
|
|
|
'parsing_spec_example.cpp',
|
|
|
|
'parsing_strings.cpp',
|
2020-02-03 09:12:43 +00:00
|
|
|
'parsing_tables.cpp',
|
|
|
|
'manipulating_arrays.cpp',
|
2020-03-03 08:10:07 +00:00
|
|
|
'manipulating_tables.cpp',
|
|
|
|
'tests.cpp'
|
2020-01-04 14:21:38 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
disable_exceptions = 'cpp_eh=none'
|
|
|
|
no_unreleased_features = '-DTOML_UNRELEASED_FEATURES=0'
|
2020-03-03 21:28:24 +00:00
|
|
|
toml_char8_strings = '-DTOML_CHAR_8_STRINGS=1'
|
2020-01-06 18:21:16 +00:00
|
|
|
manually_set_cpp_std = 'cpp_std=none'
|
|
|
|
cpp20 = '-std=c++2a'
|
2020-03-03 21:28:24 +00:00
|
|
|
use_tloptional = '-DTARTANLLAMA_OPTIONAL'
|
2020-03-18 13:28:00 +00:00
|
|
|
compiler_supports_char8_strings = compiler.compiles('''
|
|
|
|
#include <string_view>
|
|
|
|
#include <string>
|
|
|
|
using namespace std::string_view_literals;
|
|
|
|
std::u8string func()
|
|
|
|
{
|
|
|
|
return std::u8string{ u8"this is a test."sv };
|
|
|
|
}
|
|
|
|
''',
|
|
|
|
name : 'char8 string check',
|
|
|
|
args : [ '-std=c++2a' ]
|
|
|
|
)
|
2020-03-03 21:28:24 +00:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
### char
|
|
|
|
############################################################################
|
|
|
|
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
char = executable(
|
|
|
|
'char',
|
2020-01-04 14:21:38 +00:00
|
|
|
test_sources,
|
|
|
|
include_directories : inc
|
|
|
|
)
|
2020-01-06 18:21:16 +00:00
|
|
|
test('char', char)
|
2020-01-04 14:21:38 +00:00
|
|
|
|
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
char_noexcept = executable(
|
|
|
|
'char_noexcept',
|
2020-01-04 14:21:38 +00:00
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ disable_exceptions ]
|
|
|
|
)
|
2020-01-06 18:21:16 +00:00
|
|
|
test('char_noexcept', char_noexcept)
|
2020-01-04 14:21:38 +00:00
|
|
|
|
|
|
|
|
2020-02-26 23:28:20 +00:00
|
|
|
char_strict = executable(
|
|
|
|
'char_strict',
|
2020-01-04 14:21:38 +00:00
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
cpp_args : [ no_unreleased_features ]
|
|
|
|
)
|
2020-02-26 23:28:20 +00:00
|
|
|
test('char_strict', char_strict)
|
2020-01-04 14:21:38 +00:00
|
|
|
|
|
|
|
|
2020-02-26 23:28:20 +00:00
|
|
|
char_strict_noexcept = executable(
|
|
|
|
'char_strict_noexcept',
|
2020-01-04 14:21:38 +00:00
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ disable_exceptions ],
|
|
|
|
cpp_args : [ no_unreleased_features ]
|
|
|
|
)
|
2020-02-26 23:28:20 +00:00
|
|
|
test('char_strict_noexcept', char_strict_noexcept)
|
2020-01-06 18:21:16 +00:00
|
|
|
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2020-03-03 21:28:24 +00:00
|
|
|
############################################################################
|
|
|
|
### char w/ tl::optional
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
|
|
|
|
char_tlopt = executable(
|
|
|
|
'char_tlopt',
|
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
cpp_args : [ use_tloptional ]
|
|
|
|
)
|
|
|
|
test('char_tlopt', char_tlopt)
|
|
|
|
|
|
|
|
|
|
|
|
char_tlopt_strict = executable(
|
|
|
|
'char_tlopt_strict',
|
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
cpp_args : [ no_unreleased_features, use_tloptional ]
|
|
|
|
)
|
|
|
|
test('char_tlopt_strict', char_tlopt_strict)
|
|
|
|
|
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
if compiler_supports_char8_strings
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2020-03-03 21:28:24 +00:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
### char8
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
char8 = executable(
|
|
|
|
'char8',
|
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ manually_set_cpp_std ],
|
2020-03-03 21:28:24 +00:00
|
|
|
cpp_args : [ cpp20, toml_char8_strings ]
|
2020-01-06 18:21:16 +00:00
|
|
|
)
|
|
|
|
test('char8', char8)
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2020-01-06 18:21:16 +00:00
|
|
|
char8_noexcept = executable(
|
|
|
|
'char8_noexcept',
|
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ manually_set_cpp_std, disable_exceptions ],
|
2020-03-03 21:28:24 +00:00
|
|
|
cpp_args : [ cpp20, toml_char8_strings ]
|
2020-01-06 18:21:16 +00:00
|
|
|
)
|
|
|
|
test('char8_noexcept', char8_noexcept)
|
|
|
|
|
2020-02-26 23:28:20 +00:00
|
|
|
char8_strict = executable(
|
|
|
|
'char8_strict',
|
2020-01-06 18:21:16 +00:00
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ manually_set_cpp_std ],
|
2020-03-03 21:28:24 +00:00
|
|
|
cpp_args : [ cpp20, toml_char8_strings, no_unreleased_features ]
|
2020-01-06 18:21:16 +00:00
|
|
|
)
|
2020-02-26 23:28:20 +00:00
|
|
|
test('char8_strict', char8_strict)
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2020-02-26 23:28:20 +00:00
|
|
|
char8_strict_noexcept = executable(
|
|
|
|
'char8_strict_noexcept',
|
2020-01-06 18:21:16 +00:00
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ manually_set_cpp_std, disable_exceptions ],
|
2020-03-03 21:28:24 +00:00
|
|
|
cpp_args : [ cpp20, toml_char8_strings, no_unreleased_features ]
|
2020-01-06 18:21:16 +00:00
|
|
|
)
|
2020-02-26 23:28:20 +00:00
|
|
|
test('char8_strict_noexcept', char8_strict_noexcept)
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2020-03-03 21:28:24 +00:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
### char8 w/ tl::optional
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
|
|
|
|
char8_tlopt = executable(
|
|
|
|
'char8_tlopt',
|
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ manually_set_cpp_std ],
|
|
|
|
cpp_args : [ cpp20, toml_char8_strings, use_tloptional ]
|
|
|
|
)
|
|
|
|
test('char8_tlopt', char8_tlopt)
|
|
|
|
|
|
|
|
char8_tlopt_strict = executable(
|
|
|
|
'char8_tlopt_strict',
|
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
override_options : [ manually_set_cpp_std ],
|
|
|
|
cpp_args : [ cpp20, toml_char8_strings, no_unreleased_features, use_tloptional ]
|
|
|
|
)
|
|
|
|
test('char8_tlopt_strict', char8_tlopt_strict)
|
|
|
|
|
|
|
|
|
2020-03-03 08:10:07 +00:00
|
|
|
endif
|