tomlplusplus/tests/meson.build

232 lines
4.6 KiB
Meson
Raw Normal View History

new file: .circleci/config.yml new file: .editorconfig new file: .gitattributes new file: .gitignore new file: .gitmodules new file: LICENSE new file: README.md new file: examples/example.cpp new file: examples/example.toml new file: examples/meson.build new file: include/toml++/toml.h new file: include/toml++/toml_array.h new file: include/toml++/toml_common.h new file: include/toml++/toml_formatter.h new file: include/toml++/toml_node.h new file: include/toml++/toml_node_view.h new file: include/toml++/toml_parser.h new file: include/toml++/toml_table.h new file: include/toml++/toml_utf8.h new file: include/toml++/toml_utf8_generated.h new file: include/toml++/toml_value.h new file: meson.build new file: python/ci_single_header_check.py new file: python/generate_single_header.py new file: python/generate_unicode_functions.py new file: tests/catch2 new file: tests/catch2.h new file: tests/lifetimes.cpp new file: tests/main.cpp new file: tests/meson.build new file: tests/parsing_arrays.cpp new file: tests/parsing_booleans.cpp new file: tests/parsing_comments.cpp new file: tests/parsing_dates_and_times.cpp new file: tests/parsing_floats.cpp new file: tests/parsing_integers.cpp new file: tests/parsing_key_value_pairs.cpp new file: tests/parsing_spec_example.cpp new file: tests/parsing_strings.cpp new file: tests/parsing_tables.cpp new file: tests/tests.cpp new file: tests/tests.h new file: toml.hpp new file: vs/.runsettings new file: vs/example.vcxproj new file: vs/test_char.vcxproj new file: vs/test_char8.vcxproj new file: vs/test_char8_noexcept.vcxproj new file: vs/test_char_noexcept.vcxproj new file: vs/test_strict_char.vcxproj new file: vs/test_strict_char8.vcxproj new file: vs/test_strict_char8_noexcept.vcxproj new file: vs/test_strict_char_noexcept.vcxproj new file: vs/toml++.natvis new file: vs/toml++.props new file: vs/toml++.sln new file: vs/toml++.vcxproj new file: vs/toml++.vcxproj.filters
2020-01-04 14:21:38 +00:00
test_sources = [
'conformance_burntsushi_invalid.cpp',
'conformance_burntsushi_valid.cpp',
'conformance_iarna_invalid.cpp',
'conformance_iarna_valid.cpp',
'impl_toml.cpp',
'impl_catch2.cpp',
'tests.cpp',
'parsing_floats.cpp',
new file: .circleci/config.yml new file: .editorconfig new file: .gitattributes new file: .gitignore new file: .gitmodules new file: LICENSE new file: README.md new file: examples/example.cpp new file: examples/example.toml new file: examples/meson.build new file: include/toml++/toml.h new file: include/toml++/toml_array.h new file: include/toml++/toml_common.h new file: include/toml++/toml_formatter.h new file: include/toml++/toml_node.h new file: include/toml++/toml_node_view.h new file: include/toml++/toml_parser.h new file: include/toml++/toml_table.h new file: include/toml++/toml_utf8.h new file: include/toml++/toml_utf8_generated.h new file: include/toml++/toml_value.h new file: meson.build new file: python/ci_single_header_check.py new file: python/generate_single_header.py new file: python/generate_unicode_functions.py new file: tests/catch2 new file: tests/catch2.h new file: tests/lifetimes.cpp new file: tests/main.cpp new file: tests/meson.build new file: tests/parsing_arrays.cpp new file: tests/parsing_booleans.cpp new file: tests/parsing_comments.cpp new file: tests/parsing_dates_and_times.cpp new file: tests/parsing_floats.cpp new file: tests/parsing_integers.cpp new file: tests/parsing_key_value_pairs.cpp new file: tests/parsing_spec_example.cpp new file: tests/parsing_strings.cpp new file: tests/parsing_tables.cpp new file: tests/tests.cpp new file: tests/tests.h new file: toml.hpp new file: vs/.runsettings new file: vs/example.vcxproj new file: vs/test_char.vcxproj new file: vs/test_char8.vcxproj new file: vs/test_char8_noexcept.vcxproj new file: vs/test_char_noexcept.vcxproj new file: vs/test_strict_char.vcxproj new file: vs/test_strict_char8.vcxproj new file: vs/test_strict_char8_noexcept.vcxproj new file: vs/test_strict_char_noexcept.vcxproj new file: vs/toml++.natvis new file: vs/toml++.props new file: vs/toml++.sln new file: vs/toml++.vcxproj new file: vs/toml++.vcxproj.filters
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',
'parsing_tables.cpp',
'manipulating_arrays.cpp',
'manipulating_tables.cpp',
'manipulating_values.cpp',
'unicode.cpp',
'unicode_generated.cpp',
'windows_compat.cpp'
new file: .circleci/config.yml new file: .editorconfig new file: .gitattributes new file: .gitignore new file: .gitmodules new file: LICENSE new file: README.md new file: examples/example.cpp new file: examples/example.toml new file: examples/meson.build new file: include/toml++/toml.h new file: include/toml++/toml_array.h new file: include/toml++/toml_common.h new file: include/toml++/toml_formatter.h new file: include/toml++/toml_node.h new file: include/toml++/toml_node_view.h new file: include/toml++/toml_parser.h new file: include/toml++/toml_table.h new file: include/toml++/toml_utf8.h new file: include/toml++/toml_utf8_generated.h new file: include/toml++/toml_value.h new file: meson.build new file: python/ci_single_header_check.py new file: python/generate_single_header.py new file: python/generate_unicode_functions.py new file: tests/catch2 new file: tests/catch2.h new file: tests/lifetimes.cpp new file: tests/main.cpp new file: tests/meson.build new file: tests/parsing_arrays.cpp new file: tests/parsing_booleans.cpp new file: tests/parsing_comments.cpp new file: tests/parsing_dates_and_times.cpp new file: tests/parsing_floats.cpp new file: tests/parsing_integers.cpp new file: tests/parsing_key_value_pairs.cpp new file: tests/parsing_spec_example.cpp new file: tests/parsing_strings.cpp new file: tests/parsing_tables.cpp new file: tests/tests.cpp new file: tests/tests.h new file: toml.hpp new file: vs/.runsettings new file: vs/example.vcxproj new file: vs/test_char.vcxproj new file: vs/test_char8.vcxproj new file: vs/test_char8_noexcept.vcxproj new file: vs/test_char_noexcept.vcxproj new file: vs/test_strict_char.vcxproj new file: vs/test_strict_char8.vcxproj new file: vs/test_strict_char8_noexcept.vcxproj new file: vs/test_strict_char_noexcept.vcxproj new file: vs/toml++.natvis new file: vs/toml++.props new file: vs/toml++.sln new file: vs/toml++.vcxproj new file: vs/toml++.vcxproj.filters
2020-01-04 14:21:38 +00:00
]
compiler_supports_cpp20 = compiler.links('''
#include <version>
#include <string>
#include <iostream>
int main()
{
std::string s = "kek";
std::cout << s << std::endl;
return 0;
}
''',
name : 'supports C++20',
args : [ '-std=c++2a' ]
)
compiler_supports_char8 = compiler_supports_cpp20 and compiler.links('''
#include <version>
#include <string_view>
#include <string>
#include <type_traits>
using namespace std::string_view_literals;
#ifndef __cpp_lib_char8_t
#error oh noes
#endif
static_assert(!std::is_same_v<char, char8_t>);
static_assert(!std::is_same_v<std::string, std::u8string>);
std::u8string func()
{
return std::u8string{ u8"this is a test."sv };
}
int main()
{
return 0;
}
''',
name : 'supports char8_t',
args : [ '-std=c++2a', '-fchar8_t' ]
)
compiler_supports_consteval = compiler_supports_cpp20 and compiler.compiles('''
consteval int kek() noexcept
{
return 42;
}
int main()
{
return kek();
}
''',
name : 'supports consteval',
args : [ '-std=c++2a' ]
)
compiler_supports_float16_args = []
if compiler.get_id() == 'gcc'
compiler_supports_float16_args += '-mfp16-format=ieee'
endif
compiler_supports_float16 = compiler.links('''
int main()
{
static_assert(sizeof(_Float16) == 2);
_Float16 f = static_cast<_Float16>(1);
return 0;
}
''',
name : 'supports float16',
args : compiler_supports_float16_args
)
compiler_supports_fast_math = compiler.links('''
#include <cmath>
#include <iostream>
int main()
{
std::cout << std::exp2(2.0) << std::pow(2.0, 3.0) << std::endl;
return 0;
}
''',
name : 'supports fast-math',
args : [ '-ffast-math', '-ffp-contract=fast' ]
)
fast_math_modes = [ false, true ]
exception_modes = [ true, false ]
strict_modes = [ false, true ]
cpp20_modes = [ false, true ]
executables = []
counter = 0
foreach cpp20 : cpp20_modes
foreach strict : strict_modes
if cpp20 and not compiler_supports_cpp20
continue
endif
foreach fast_math : fast_math_modes
if fast_math and not compiler_supports_fast_math
continue
endif
foreach exceptions : exception_modes
name = ''
overrides = []
args = []
if compiler_supports_float16
if compiler.get_id() == 'gcc'
args += '-mfp16-format=ieee'
endif
endif
if cpp20
name = 'cpp20'
overrides += 'cpp_std=none'
args += '-std=c++2a'
if compiler_supports_char8
args += '-fchar8_t'
endif
else
name = 'cpp17'
endif
if strict
name = name + '_strict'
args += '-DTOML_UNRELEASED_FEATURES=0'
else
args += '-DTOML_UNRELEASED_FEATURES=1'
endif
if not exceptions
name = name + '_noexcept'
overrides += 'cpp_eh=none'
endif
if fast_math
name = name + '_fastmath'
if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang'
args += '-ffast-math'
args += '-ffp-contract=fast'
endif
endif
if counter % 6 == 3
args += '-DTOML_ALL_INLINE=1'
endif
if counter % 2 == 1
args += '-DUSE_SINGLE_HEADER=1'
endif
if counter % 4 == 2 and exceptions
args += '-DUSE_TARTANLLAMA_OPTIONAL=1'
name = name + '_tlopt'
endif
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'
endif
executables += [[
name,
executable(
name,
test_sources,
include_directories : inc,
cpp_args : args,
override_options : overrides
)
]]
counter = counter + 1
endforeach # exceptions
endforeach # fast_math
endforeach # strict
endforeach # cpp20
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'
]
foreach executable : executables
foreach locale : locales
test(executable[0] + ' (' + locale + ')', executable[1], env : ['LC_ALL=' + locale])
endforeach
endforeach