2020-01-04 14:21:38 +00:00
|
|
|
test_sources = [
|
2020-06-25 14:33:01 +00:00
|
|
|
'conformance.cpp',
|
2020-04-02 21:39:21 +00:00
|
|
|
'impl_toml.cpp',
|
|
|
|
'impl_catch2.cpp',
|
2020-04-06 12:57:49 +00:00
|
|
|
'tests.cpp',
|
|
|
|
'parsing_floats.cpp',
|
2020-01-04 14:21:38 +00:00
|
|
|
'parsing_arrays.cpp',
|
|
|
|
'parsing_booleans.cpp',
|
|
|
|
'parsing_comments.cpp',
|
|
|
|
'parsing_dates_and_times.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',
|
2020-04-06 12:57:49 +00:00
|
|
|
'manipulating_values.cpp',
|
2020-04-18 13:14:07 +00:00
|
|
|
'unicode.cpp',
|
|
|
|
'unicode_generated.cpp',
|
2020-01-04 14:21:38 +00:00
|
|
|
]
|
|
|
|
|
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
|
|
|
|
2020-04-06 12:57:49 +00:00
|
|
|
character_types = ['char', 'char8']
|
|
|
|
exception_modes = [ true, false ]
|
|
|
|
unreleased_feature_modes = [ true, false ]
|
|
|
|
tloptional_modes = [ true, false ]
|
|
|
|
executables = []
|
2020-06-24 18:05:23 +00:00
|
|
|
counter = 0
|
2020-04-06 12:57:49 +00:00
|
|
|
foreach character_type : character_types
|
|
|
|
if character_type == 'char8' and not compiler_supports_char8_strings
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
foreach exceptions : exception_modes
|
|
|
|
foreach unreleased_features : unreleased_feature_modes
|
|
|
|
foreach tloptional : tloptional_modes
|
|
|
|
|
|
|
|
if tloptional and not (character_type =='char' and unreleased_features and exceptions)
|
|
|
|
continue
|
|
|
|
endif
|
|
|
|
|
|
|
|
name = character_type
|
|
|
|
overrides = []
|
|
|
|
args = []
|
|
|
|
|
|
|
|
if character_type =='char8'
|
|
|
|
overrides += 'cpp_std=none'
|
|
|
|
args += '-DTOML_CHAR_8_STRINGS=1'
|
|
|
|
args += '-std=c++2a'
|
|
|
|
endif
|
|
|
|
|
2020-04-10 16:46:00 +00:00
|
|
|
if unreleased_features
|
|
|
|
args += '-DTOML_UNRELEASED_FEATURES=1'
|
|
|
|
else
|
2020-04-06 12:57:49 +00:00
|
|
|
name = name + '_strict'
|
|
|
|
args += '-DTOML_UNRELEASED_FEATURES=0'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if not exceptions
|
|
|
|
name = name + '_noexcept'
|
|
|
|
overrides += 'cpp_eh=none'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if tloptional
|
|
|
|
name = name + '_tlopt'
|
2020-06-24 18:05:23 +00:00
|
|
|
args += '-DUSE_TARTANLLAMA_OPTIONAL=1'
|
|
|
|
endif
|
|
|
|
|
|
|
|
args += '-DTEST_BUILD_ID=@0@'.format(counter)
|
|
|
|
|
|
|
|
if compiler.get_id() == 'gcc'
|
|
|
|
args += '-Wno-padded'
|
|
|
|
args += '-Wno-float-equal'
|
|
|
|
endif
|
|
|
|
|
|
|
|
if compiler.get_id() == 'clang'
|
|
|
|
args += '-Wno-padded'
|
|
|
|
args += '-Wno-float-equal'
|
|
|
|
args += '-Wno-double-promotion'
|
2020-04-06 12:57:49 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
executables += [[
|
|
|
|
name,
|
|
|
|
executable(
|
|
|
|
name,
|
|
|
|
test_sources,
|
|
|
|
include_directories : inc,
|
|
|
|
cpp_args : args,
|
|
|
|
override_options : overrides
|
|
|
|
)
|
|
|
|
]]
|
|
|
|
|
2020-06-24 18:05:23 +00:00
|
|
|
counter = counter + 1
|
|
|
|
|
2020-04-06 12:57:49 +00:00
|
|
|
endforeach # tloptional_modes
|
|
|
|
endforeach # unreleased_feature_modes
|
|
|
|
endforeach # exception_modes
|
|
|
|
endforeach # character_type
|
|
|
|
|
|
|
|
locales = [
|
|
|
|
'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
|
|
|
|
2020-04-06 12:57:49 +00:00
|
|
|
foreach locale : locales
|
|
|
|
foreach executable : executables
|
|
|
|
test(locale + '_' + executable[0], executable[1], env : ['LC_ALL=' + locale])
|
|
|
|
endforeach
|
|
|
|
endforeach
|