test(shell): add command line tests

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-05-26 04:53:04 -07:00
parent dbe55bf84a
commit bb9830f10c
2 changed files with 15 additions and 15 deletions

View file

@ -6,21 +6,21 @@ install(TARGETS lean DESTINATION bin)
# 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")
# 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")
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")
# 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")
# add_test(lean_unknown_option ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "-z")
add_test(lean_unknown_option ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "-z")
# add_test(lean_unknown_file1 ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "boofoo.lean")
# add_test(lean_unknown_file2 ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "boofoo.lua")
add_test(lean_unknown_file2 ${LEAN_SOURCE_DIR}/cmake/check_failure.sh "${CMAKE_CURRENT_BINARY_DIR}/lean" "boofoo.lua")
# # LEAN EXAMPLES
# file(GLOB LEANEXAMPLES "${LEAN_SOURCE_DIR}/../examples/lean/*.lean")
@ -118,4 +118,3 @@ endif()
# 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)

View file

@ -1,5 +1,6 @@
import("util.lua")
f, a, b = Consts("f, a, b")
f = Const("f")
a = Const("a")
b = Const("b")
nodes = {}
function mk_big(num)