Hi,
I've spent the last day updating my CMake build for Lua to work with the 5.5.0-beta release, and this is now working and available here:
https://gitlab.com/codelibre/lua/lua-cmake/-/tree/lua-cmake-5.5-beta?ref_type=heads
Most of this work isn't so much CMake as it is portability work on the testsuite, making it work on Linux, FreeBSD and Windows. You can see the overall changes, including those to the tests, here:
with the results of this here: https://gitlab.com/codelibre/lua/lua-cmake/-/pipelines/2012837492
What I've essentially done is run the tests with some added context in the environment (examples for Windows and FreeBSD):
The tests have then been adapted to use these to modify their behaviour with information they would otherwise not have about the test environment. This allows the tests to work when readline is configured or not, or when the search paths are different within the build tree or use platform-specific extensions, or when dynamic loading is disabled, etc. It also allows all of the process creation via system() or popen() to work with the Windows cmd.exe shell as well as /bin/sh, though this did require duplicating the test logic to have separate lines using sh or cmd. However, it works and this allows for the full testsuite to run successfully to completion on most platforms by removing hardcoded platform-specific assumptions which would cause breakage.
One fix was in files.lua when using /dev/full. Its behaviour is different between Linux and FreeBSD on close(), so I made it work for both cases when LUA_PLATFORM=POSIX by removing an assertion. But if we added Linux as a platform then the checking of close() could be special-cased to account for the behaviour differences.
I've attached a patch which pulls out the test-specific changes from the above changes. The test invocation would need updating to use the above environment variables.
If there is interest in making the testsuite more portable to other platforms, I hope this is useful as inspiration or a starting point.
Kind regards,
Roger