forked from LuaJIT/LuaJIT
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix LuaJIT-tests for old libc version
The `strtod parsing` subtest in the <lib/base/tonumber_scan.lua> checks the results yielded by the `strtod()` via FFI call. In versions before 2.19 it returns an incorrect result for "0x1p-2075" [1]. This patch skips this test for a smaller version of the libc installed. [1]: https://sourceware.org/bugzilla/show_bug.cgi?id=16151
- Loading branch information
Showing
4 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Get the libc version installed in the system. | ||
# XXX: uses `LibRealPath`, so unsupported for OSX. | ||
macro(GetLibCVersion output) | ||
LibRealPath(libcpath "libc.so.6") | ||
|
||
# Get the version from the library name. | ||
if(libcpath MATCHES "libc-([0-9]+\.[0-9]+)\.so") | ||
set(${output} ${CMAKE_MATCH_1}) | ||
else() | ||
# Try to directly run the library and parse the version from | ||
# the output message. | ||
execute_process( | ||
COMMAND ${libcpath} | ||
OUTPUT_VARIABLE LIB_C_INFO | ||
ERROR_VARIABLE ERROR_MSG | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
RESULT_VARIABLE RES | ||
) | ||
|
||
if(NOT RES EQUAL 0) | ||
message(FATAL_ERROR "Executing '${libcpath}' has failed: '${ERROR_MSG}'") | ||
endif() | ||
|
||
if(LIB_C_INFO MATCHES "^.*stable release version ([0-9]+\.[0-9]+)") | ||
set(${output} ${CMAKE_MATCH_1}) | ||
else() | ||
message(FATAL_ERROR "Can't determine libc version") | ||
endif() | ||
|
||
unset(RES) | ||
unset(ERROR_MSG) | ||
unset(LIB_C_INFO) | ||
endif() | ||
unset(CMAKE_MATCH_1) | ||
endmacro() |