2013-07-17 05:10:18 +00:00
|
|
|
add_executable(lean lean.cpp)
|
2013-07-18 16:12:07 +00:00
|
|
|
target_link_libraries(lean ${EXTRA_LIBS})
|
2013-12-06 05:54:55 +00:00
|
|
|
|
2013-12-26 00:18:51 +00:00
|
|
|
install(TARGETS lean DESTINATION bin)
|
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# add_test(example1_stdin1 ${LEAN_SOURCE_DIR}/cmake/redirect.sh ${CMAKE_CURRENT_BINARY_DIR}/lean "${LEAN_SOURCE_DIR}/../tests/lean/single.lean")
|
|
|
|
# add_test(example1_stdin2 ${LEAN_SOURCE_DIR}/cmake/redirect.sh ${CMAKE_CURRENT_BINARY_DIR}/lean "-l" "${LEAN_SOURCE_DIR}/../tests/lean/single.lean")
|
|
|
|
# add_test(example1_stdin3 ${LEAN_SOURCE_DIR}/cmake/redirect.sh ${CMAKE_CURRENT_BINARY_DIR}/lean "--lean" "${LEAN_SOURCE_DIR}/../tests/lean/single.lean")
|
2014-05-26 11:53:04 +00:00
|
|
|
add_test(lean_help1 ${CMAKE_CURRENT_BINARY_DIR}/lean --help)
|
|
|
|
add_test(lean_help2 ${CMAKE_CURRENT_BINARY_DIR}/lean --h)
|
|
|
|
add_test(lean_version1 ${CMAKE_CURRENT_BINARY_DIR}/lean --version)
|
|
|
|
add_test(lean_version2 ${CMAKE_CURRENT_BINARY_DIR}/lean --v)
|
|
|
|
add_test(lean_ghash1 ${CMAKE_CURRENT_BINARY_DIR}/lean -g)
|
|
|
|
add_test(lean_ghash2 ${CMAKE_CURRENT_BINARY_DIR}/lean --githash)
|
|
|
|
add_test(lean_path1 ${CMAKE_CURRENT_BINARY_DIR}/lean -p)
|
|
|
|
add_test(lean_path2 ${CMAKE_CURRENT_BINARY_DIR}/lean --path)
|
|
|
|
add_test(lean_luahook1 ${CMAKE_CURRENT_BINARY_DIR}/lean --luahook=100 "${LEAN_SOURCE_DIR}/../tests/lua/big.lua")
|
|
|
|
add_test(lean_luahook2 ${CMAKE_CURRENT_BINARY_DIR}/lean -c 100 "${LEAN_SOURCE_DIR}/../tests/lua/big.lua")
|
2014-04-29 00:49:23 +00:00
|
|
|
# add_test(lean_lua1 ${LEAN_SOURCE_DIR}/cmake/redirect.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "--lua" "${LEAN_SOURCE_DIR}/../tests/lua/single.lua")
|
|
|
|
# add_test(lean_lua2 ${LEAN_SOURCE_DIR}/cmake/redirect.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "-u" "${LEAN_SOURCE_DIR}/../tests/lua/single.lua")
|
2014-05-26 11:53:04 +00:00
|
|
|
add_test(lean_unknown_option ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "-z")
|
2014-04-29 00:49:23 +00:00
|
|
|
# add_test(lean_unknown_file1 ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "boofoo.lean")
|
2014-05-26 11:53:04 +00:00
|
|
|
add_test(lean_unknown_file2 ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "boofoo.lua")
|
2013-12-09 20:17:43 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # LEAN EXAMPLES
|
|
|
|
# file(GLOB LEANEXAMPLES "${LEAN_SOURCE_DIR}/../examples/lean/*.lean")
|
|
|
|
# FOREACH(T ${LEANEXAMPLES})
|
|
|
|
# GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
# add_test(NAME "leanex_${T_NAME}"
|
|
|
|
# COMMAND ${CMAKE_CURRENT_BINARY_DIR}/lean ${T})
|
|
|
|
# ENDFOREACH(T)
|
2013-12-06 05:54:55 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # LEAN TESTS
|
|
|
|
# file(GLOB LEANTESTS "${LEAN_SOURCE_DIR}/../tests/lean/*.lean")
|
|
|
|
# FOREACH(T ${LEANTESTS})
|
|
|
|
# GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
# add_test(NAME "leantest_${T_NAME}"
|
|
|
|
# WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean"
|
|
|
|
# COMMAND "./test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean -t" ${T_NAME})
|
|
|
|
# ENDFOREACH(T)
|
2013-12-20 00:16:56 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # LEAN PP TESTS
|
|
|
|
# # For making sure that Lean can parse the output produced by its pretty printer
|
|
|
|
# file(GLOB LEANPPTESTS "${LEAN_SOURCE_DIR}/../tests/lean/*.lean")
|
|
|
|
# FOREACH(T ${LEANPPTESTS})
|
|
|
|
# GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
# add_test(NAME "leanpptest_${T_NAME}"
|
|
|
|
# WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean"
|
|
|
|
# COMMAND "./test_single_pp.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean -t" ${T})
|
|
|
|
# ENDFOREACH(T)
|
2013-11-18 23:02:12 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # LEAN INTERACTIVE TESTS
|
|
|
|
# file(GLOB LEANINTERACTIVETESTS "${LEAN_SOURCE_DIR}/../tests/lean/interactive/*.lean")
|
|
|
|
# FOREACH(T ${LEANINTERACTIVETESTS})
|
|
|
|
# GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
# add_test(NAME "leaninteractivetest_${T_NAME}"
|
|
|
|
# WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean/interactive"
|
|
|
|
# COMMAND "./test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean" ${T_NAME})
|
|
|
|
# ENDFOREACH(T)
|
2013-12-06 00:56:20 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # LEAN SLOW TESTS
|
|
|
|
# file(GLOB LEANSLOWTESTS "${LEAN_SOURCE_DIR}/../tests/lean/slow/*.lean")
|
|
|
|
# FOREACH(T ${LEANSLOWTESTS})
|
|
|
|
# GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
# add_test(NAME "leanslowtest_${T_NAME}"
|
|
|
|
# WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean/slow"
|
|
|
|
# COMMAND "../test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean -t" ${T_NAME})
|
|
|
|
# ENDFOREACH(T)
|
2013-11-20 00:47:47 +00:00
|
|
|
|
2014-04-29 17:36:57 +00:00
|
|
|
# LEAN LUA TESTS
|
|
|
|
file(GLOB LEANLUATESTS "${LEAN_SOURCE_DIR}/../tests/lua/*.lua")
|
|
|
|
FOREACH(T ${LEANLUATESTS})
|
|
|
|
GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
add_test(NAME "leanluatest_${T_NAME}"
|
|
|
|
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lua"
|
|
|
|
COMMAND "./test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean -t" ${T_NAME})
|
|
|
|
ENDFOREACH(T)
|
2013-11-20 00:47:47 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # LEAN DOCS
|
|
|
|
# file(GLOB LEANDOCS "${LEAN_SOURCE_DIR}/../doc/lean/*.md")
|
|
|
|
# FOREACH(T ${LEANDOCS})
|
|
|
|
# GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
# add_test(NAME "leandoc_${T_NAME}"
|
|
|
|
# WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../doc/lean"
|
|
|
|
# COMMAND "./test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean -t" ${T})
|
|
|
|
# ENDFOREACH(T)
|
2014-01-05 21:16:47 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # LEAN LUA DOCS
|
|
|
|
# file(GLOB LEANLUADOCS "${LEAN_SOURCE_DIR}/../doc/lua/*.md")
|
|
|
|
# FOREACH(T ${LEANLUADOCS})
|
|
|
|
# GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
# add_test(NAME "leanluadoc_${T_NAME}"
|
|
|
|
# WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../doc/lua"
|
|
|
|
# COMMAND "./test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean -t" ${T})
|
|
|
|
# ENDFOREACH(T)
|
2013-11-20 00:47:47 +00:00
|
|
|
|
2014-05-09 01:53:36 +00:00
|
|
|
# LEAN LUA THREAD TESTS
|
|
|
|
if((${CYGWIN} EQUAL "1") OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
|
|
|
|
if ((NOT (${CMAKE_CXX_COMPILER} MATCHES "clang")) AND (${MULTI_THREAD} MATCHES "ON"))
|
|
|
|
file(GLOB LEANLUATHREADTESTS "${LEAN_SOURCE_DIR}/../tests/lua/threads/*.lua")
|
|
|
|
FOREACH(T ${LEANLUATHREADTESTS})
|
|
|
|
GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
|
|
|
|
add_test(NAME "leanluathreadtest_${T_NAME}"
|
|
|
|
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lua/threads"
|
|
|
|
COMMAND "../test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean -t" ${T})
|
|
|
|
ENDFOREACH(T)
|
|
|
|
endif()
|
|
|
|
endif()
|
2014-01-10 18:58:35 +00:00
|
|
|
|
2014-04-29 00:49:23 +00:00
|
|
|
# # Create the script lean.sh
|
|
|
|
# # This is used to create a soft dependency on the Lean executable
|
|
|
|
# # Some rules can only be applied if the lean executable exists,
|
|
|
|
# # but we don't want a dependency on the executable because
|
|
|
|
# # the rules would be applied whenever the executable is rebuilt.
|
|
|
|
# # These are the rules for automatically generating .olean files and
|
|
|
|
# # C++/Lean interface files.
|
|
|
|
# add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lean.sh
|
|
|
|
# COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mk_lean_sh.sh ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
# DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lean)
|
|
|
|
# add_custom_target(lean_sh DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lean.sh)
|