toml11/tests
Moritz Klammler b10348c576 More flexible https://github.com/toml-lang/toml handling
Instead of unconditionally attempting to clone from a fixed location
(GitHub) during the build / test process, honor the following two
configuration variables:

  TOML11_LANGSPEC_GIT_REPOSITORY
    Can be set to override the URL from which the repository is cloned.
    This allows using a local mirror, including file:// URLs for working
    offline or reducing network traffic.

  TOML11_LANGSPEC_SOURCE_DIR
    Can be set to configure the location at which the repository is
    expected.  If it already exists no download will be attempted.  This
    allows avoiding the additional git-clone(1) altogether and use an
    existing directory as-is.  This offers two new possibilities:
    (1) The same checkout can be reused for building multiple
    configurations (e.g. Debug versus Release) saving a little bit of
    time and disk space.
    (2) Experimental changes can easily be applied to the local source
    tree without having them destroyed by the build process.

In order for this flexible location to work, the unit tests which
attempt to read files from the repository had to be adjusted.  They now
honor an environment variable TOMLDIR which can be set to point to an
alternate root directory.

All defaults are set such that the previous behavior is maintained.

Instead of introducing the TOMLDIR environment variable, an alternative
solution would have been to set the WORKING_DIRECTORY of the tests to
the TOML11_LANGSPEC_SOURCE_DIR and leave the relative paths in these
tests hard-coded.  Alas, some tests also expect that they can /write/
into the current working directory which isn't desirable if it is
potentially pointing outside the build tree.  I personally prefer to
mount the source directory read-only and build in a fast tempfs, so this
would e a problem.  To be perfectly honest, I don't quite understand why
these tests need to write to the file system in the first place, though.
It seems to me that refactoring them to serialize to a std::ostrstream
instead of a std::ofstream would not only simplify but also speed up the
unit tests and avoid file system problems.  But there might have been a
hidden reason why actually using the real file system was considered
necessary for these tests, so I didn't went ahead with that change yet.
2022-09-29 19:02:52 +02:00
..
check_serialization.cpp ci: add a patch to avoid nan comparison 2021-06-30 01:18:42 +09:00
check_toml_test.cpp test: update typename in json for toml-test 2021-06-27 18:58:10 +09:00
check.cpp ci: fix name of directory and add test script 2019-03-17 19:20:24 +09:00
CMakeLists.txt More flexible https://github.com/toml-lang/toml handling 2022-09-29 19:02:52 +02:00
test_comments.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_datetime.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_error_detection.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_expect.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_extended_conversions.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_find_or_recursive.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_find_or.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_find.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_format_error.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_get_or.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_get.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_lex_aux.hpp refactor: remove template from detail::location 2020-07-25 21:06:26 +09:00
test_lex_boolean.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_lex_datetime.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_lex_floating.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_lex_integer.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_lex_key_comment.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_lex_string.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_literals.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_multiple_translation_unit_1.cpp test: update test for multiple translation units 2019-06-02 22:00:56 +09:00
test_multiple_translation_unit_2.cpp test: add test for multiple translation unit 2019-03-18 12:39:58 +09:00
test_parse_array.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_aux.hpp refactor: remove template from detail::location 2020-07-25 21:06:26 +09:00
test_parse_boolean.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_datetime.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_file.cpp More flexible https://github.com/toml-lang/toml handling 2022-09-29 19:02:52 +02:00
test_parse_floating.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_inline_table.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_integer.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_key.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_string.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_table_key.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_table.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_parse_unicode.cpp More flexible https://github.com/toml-lang/toml handling 2022-09-29 19:02:52 +02:00
test_result.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_serialize_file.cpp More flexible https://github.com/toml-lang/toml handling 2022-09-29 19:02:52 +02:00
test_string.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_traits.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_utility.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_value.cpp Autodetect the best option to use Boost.Test 2022-09-29 17:59:28 +02:00
test_windows.cpp test: remove needless u8s from ascii characters 2020-09-16 21:25:04 +09:00