2013-07-18 16:12:07 +00:00
|
|
|
configure_file("${LEAN_SOURCE_DIR}/shell/version.h.in" "${LEAN_BINARY_DIR}/version.h")
|
2013-07-17 05:10:18 +00:00
|
|
|
include_directories("${LEAN_BINARY_DIR}")
|
|
|
|
add_executable(lean lean.cpp)
|
2013-12-04 19:21:26 +00:00
|
|
|
add_dependencies(lean githash)
|
2013-07-18 16:12:07 +00:00
|
|
|
target_link_libraries(lean ${EXTRA_LIBS})
|
2013-09-04 03:42:20 +00:00
|
|
|
add_test(example1 ${CMAKE_CURRENT_BINARY_DIR}/lean "${LEAN_SOURCE_DIR}/../examples/lean/ex1.lean")
|
|
|
|
add_test(example2 ${CMAKE_CURRENT_BINARY_DIR}/lean "${LEAN_SOURCE_DIR}/../examples/lean/ex2.lean")
|
2013-09-04 12:39:35 +00:00
|
|
|
add_test(example3 ${CMAKE_CURRENT_BINARY_DIR}/lean "${LEAN_SOURCE_DIR}/../examples/lean/ex3.lean")
|
2013-11-18 17:13:34 +00:00
|
|
|
add_test(example1_stdin ${CMAKE_CURRENT_BINARY_DIR}/lean < "${LEAN_SOURCE_DIR}/../examples/lean/ex1.lean")
|
2013-11-18 23:02:12 +00:00
|
|
|
|
2013-12-06 00:56:20 +00:00
|
|
|
# LEAN TESTS
|
2013-11-18 23:02:12 +00:00
|
|
|
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})
|
|
|
|
ENDFOREACH(T)
|
|
|
|
|
2013-12-06 00:56:20 +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})
|
|
|
|
ENDFOREACH(T)
|
|
|
|
|
|
|
|
# LEAN SLOW TESTS
|
2013-11-18 23:02:12 +00:00
|
|
|
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})
|
|
|
|
ENDFOREACH(T)
|
2013-11-20 00:47:47 +00:00
|
|
|
|
2013-12-06 00:56:20 +00:00
|
|
|
# LEAN LUA TESTS
|
2013-11-20 00:47:47 +00:00
|
|
|
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})
|
|
|
|
ENDFOREACH(T)
|
|
|
|
|
2013-12-06 00:56:20 +00:00
|
|
|
# LEAN LUA DOCS
|
2013-11-20 00:47:47 +00:00
|
|
|
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})
|
|
|
|
ENDFOREACH(T)
|
|
|
|
|
2013-12-06 00:56:20 +00:00
|
|
|
# LEAN LUA THREAD TESTS
|
2013-11-20 00:47:47 +00:00
|
|
|
if((${CYGWIN} EQUAL "1") OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
|
2013-12-04 18:27:18 +00:00
|
|
|
if ((NOT (${CMAKE_CXX_COMPILER} MATCHES "clang")) AND (${THREAD_SAFE} MATCHES "ON"))
|
2013-11-27 23:06:07 +00:00
|
|
|
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})
|
|
|
|
ENDFOREACH(T)
|
2013-11-20 00:47:47 +00:00
|
|
|
endif()
|
|
|
|
endif()
|