PEGTL
PEGTL copied to clipboard
MSYS2 environment is not considered in tests
3 Tests fail on msys, since wrong file names are used in those cases.
src/test/pegtl/file_file.cpp
src/test/pegtl/file_mmap.cpp
src/test/pegtl/file_read.cpp
In this code MSYS isn't considered and handled incorrectly
src/test/pegtl/verify_file.hpp:11
#if defined( _MSC_VER )
#define TAO_PEGTL_TEST_FILENAME u"src/test/pegtl/file_äöü𝄞_data.txt"
#else
#define TAO_PEGTL_TEST_FILENAME "src/test/pegtl/file_äöü𝄞_data.txt"
#endif
I think fixing this is easy, just detect msys2 and use the correct string format there.
See e.g. this CI run as example
That does sound like an easy fix, however I'm not sure what "the correct format" for MSYS2 is, and I don't have an environment to test it myself. In other words, can you please let me know whether
#if defined( _MSC_VER ) || defined( __MSYS__ )
#define TAO_PEGTL_TEST_FILENAME u"src/test/pegtl/file_äöü𝄞_data.txt"
#else
#define TAO_PEGTL_TEST_FILENAME "src/test/pegtl/file_äöü𝄞_data.txt"
#endif
or
#if defined( _MSC_VER ) && !defined( __MSYS__ )
#define TAO_PEGTL_TEST_FILENAME u"src/test/pegtl/file_äöü𝄞_data.txt"
#else
#define TAO_PEGTL_TEST_FILENAME "src/test/pegtl/file_äöü𝄞_data.txt"
#endif
is needed?
Note to self: https://www.msys2.org/wiki/Porting/
That does sound like an easy fix, however I'm not sure what "the correct format" for MSYS2 is, and I don't have an environment to test it myself. In other words, can you please let me know whether
#if defined( _MSC_VER ) || defined( __MSYS__ ) #define TAO_PEGTL_TEST_FILENAME u"src/test/pegtl/file_äöü𝄞_data.txt" #else #define TAO_PEGTL_TEST_FILENAME "src/test/pegtl/file_äöü𝄞_data.txt" #endifor
#if defined( _MSC_VER ) && !defined( __MSYS__ ) #define TAO_PEGTL_TEST_FILENAME u"src/test/pegtl/file_äöü𝄞_data.txt" #else #define TAO_PEGTL_TEST_FILENAME "src/test/pegtl/file_äöü𝄞_data.txt" #endifis needed?
I am not entirely sure myself either, but I can test it, if msys support is planned a CI would be helpful too, maybe I can contribute one