chore(build): only execute lua multi-threading tests when on cygwin or linux, and using g++
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
5e170ce5fe
commit
a74412963a
2 changed files with 19 additions and 0 deletions
|
@ -3,3 +3,11 @@ target_link_libraries(leanlua ${EXTRA_LIBS})
|
||||||
add_test(NAME leanluatests
|
add_test(NAME leanluatests
|
||||||
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lua"
|
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lua"
|
||||||
COMMAND "./test.sh" "${CMAKE_CURRENT_BINARY_DIR}/leanlua")
|
COMMAND "./test.sh" "${CMAKE_CURRENT_BINARY_DIR}/leanlua")
|
||||||
|
|
||||||
|
if((${CYGWIN} EQUAL "1") OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
|
||||||
|
if (NOT (${CMAKE_CXX_COMPILER} MATCHES "clang"))
|
||||||
|
add_test(NAME leanluathreadtests
|
||||||
|
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lua/threads"
|
||||||
|
COMMAND "../test.sh" "${CMAKE_CURRENT_BINARY_DIR}/leanlua")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
11
tests/lua/threads/util.lua
Normal file
11
tests/lua/threads/util.lua
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
-- Execute f, and make sure is throws an error
|
||||||
|
function check_error(f)
|
||||||
|
ok, msg = pcall(function ()
|
||||||
|
f()
|
||||||
|
end)
|
||||||
|
if ok then
|
||||||
|
error("unexpected success...")
|
||||||
|
else
|
||||||
|
print("caught expected error: ", msg)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue