2023-01-22 19:53:21 +00:00
|
|
|
# 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
|
|
|
|
|
|
|
|
assert(build_tests)
|
|
|
|
|
|
|
|
test_sources = files(
|
2022-01-06 11:26:01 +00:00
|
|
|
'at_path.cpp',
|
2020-07-05 15:08:28 +00:00
|
|
|
'conformance_burntsushi_invalid.cpp',
|
|
|
|
'conformance_burntsushi_valid.cpp',
|
|
|
|
'conformance_iarna_invalid.cpp',
|
|
|
|
'conformance_iarna_valid.cpp',
|
2021-10-29 20:59:53 +00:00
|
|
|
'formatters.cpp',
|
2022-04-24 17:21:59 +00:00
|
|
|
'for_each.cpp',
|
2020-04-02 21:39:21 +00:00
|
|
|
'impl_toml.cpp',
|
2022-04-24 17:21:59 +00:00
|
|
|
'main.cpp',
|
|
|
|
'manipulating_arrays.cpp',
|
|
|
|
'manipulating_parse_result.cpp',
|
|
|
|
'manipulating_tables.cpp',
|
|
|
|
'manipulating_values.cpp',
|
2020-01-04 14:21:38 +00:00
|
|
|
'parsing_arrays.cpp',
|
|
|
|
'parsing_booleans.cpp',
|
|
|
|
'parsing_comments.cpp',
|
|
|
|
'parsing_dates_and_times.cpp',
|
2022-04-24 17:21:59 +00:00
|
|
|
'parsing_floats.cpp',
|
2020-01-04 14:21:38 +00:00
|
|
|
'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',
|
2022-06-04 21:14:50 +00:00
|
|
|
'path.cpp',
|
2022-04-24 17:21:59 +00:00
|
|
|
'tests.cpp',
|
2020-07-27 22:04:52 +00:00
|
|
|
'user_feedback.cpp',
|
2020-12-18 16:08:15 +00:00
|
|
|
'using_iterators.cpp',
|
2022-04-24 17:21:59 +00:00
|
|
|
'visit.cpp',
|
2020-07-13 18:18:04 +00:00
|
|
|
'windows_compat.cpp'
|
2023-01-22 19:53:21 +00:00
|
|
|
)
|
2020-01-04 14:21:38 +00:00
|
|
|
|
2022-05-01 12:09:09 +00:00
|
|
|
test_deps = [ tomlplusplus_dep ]
|
|
|
|
if not get_option('use_vendored_libs')
|
|
|
|
test_deps += dependency('catch2')
|
|
|
|
endif
|
2022-02-14 17:41:52 +00:00
|
|
|
|
2023-01-22 19:53:21 +00:00
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
|
|
|
# tests.exe
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
2022-04-18 09:27:54 +00:00
|
|
|
|
2023-01-22 19:53:21 +00:00
|
|
|
test_args = []
|
|
|
|
test_args += global_args
|
|
|
|
if has_exceptions
|
|
|
|
test_args += cpp.get_supported_arguments('-DSHOULD_HAVE_EXCEPTIONS=1')
|
|
|
|
else
|
|
|
|
test_args += cpp.get_supported_arguments('-DSHOULD_HAVE_EXCEPTIONS=0')
|
|
|
|
endif
|
|
|
|
if get_option('use_vendored_libs')
|
|
|
|
test_args += cpp.get_supported_arguments('-DUSE_VENDORED_LIBS=1')
|
|
|
|
else
|
|
|
|
test_args += cpp.get_supported_arguments('-DUSE_VENDORED_LIBS=0')
|
|
|
|
endif
|
2022-05-01 12:09:09 +00:00
|
|
|
|
2020-09-05 10:26:12 +00:00
|
|
|
|
2023-01-22 19:53:21 +00:00
|
|
|
test_exe = executable(
|
|
|
|
'tomlplusplus_tests',
|
|
|
|
test_sources,
|
|
|
|
cpp_args: test_args,
|
|
|
|
dependencies: test_deps,
|
|
|
|
override_options: global_overrides
|
|
|
|
)
|
2020-07-17 13:33:56 +00:00
|
|
|
|
2023-01-22 19:53:21 +00:00
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
|
|
|
# per-locale invocations
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
2020-04-06 12:57:49 +00:00
|
|
|
|
2022-01-13 10:09:07 +00:00
|
|
|
test_locales = [
|
2020-04-06 12:57:49 +00:00
|
|
|
'C',
|
|
|
|
'en_US.utf8',
|
|
|
|
'ja_JP.utf8',
|
|
|
|
'it_IT.utf8',
|
|
|
|
'tr_TR.utf8',
|
|
|
|
'fi_FI.utf8',
|
|
|
|
'fr_FR.utf8',
|
|
|
|
'zh_CN.utf8',
|
|
|
|
'de_DE.utf8'
|
|
|
|
]
|
2020-03-03 21:28:24 +00:00
|
|
|
|
2023-01-22 19:53:21 +00:00
|
|
|
foreach locale : test_locales
|
|
|
|
test(
|
|
|
|
'tests - ' + locale,
|
|
|
|
test_exe,
|
|
|
|
env: ['LC_ALL=' + locale],
|
|
|
|
workdir: meson.project_source_root()/'tests'
|
|
|
|
)
|
2020-04-06 12:57:49 +00:00
|
|
|
endforeach
|
2022-01-12 23:24:09 +00:00
|
|
|
|
2023-01-22 19:53:21 +00:00
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
|
|
|
# ODR build test
|
|
|
|
#-----------------------------------------------------------------------------------------------------------------------
|
2022-01-12 23:24:09 +00:00
|
|
|
|
|
|
|
# add the ODR-test build project
|
|
|
|
executable(
|
2023-01-22 19:53:21 +00:00
|
|
|
'tomlplusplus_odr_test',
|
|
|
|
files( 'odr_test_1.cpp', 'odr_test_2.cpp' ),
|
|
|
|
cpp_args: test_args,
|
|
|
|
dependencies: test_deps
|
2022-01-12 23:24:09 +00:00
|
|
|
)
|