chore(tests/lean/fail): add tests that check for positive exit values

This commit is contained in:
Gabriel Ebner 2017-01-05 08:09:00 +01:00 committed by Leonardo de Moura
parent bc09a53f71
commit fb2ac90cf4
4 changed files with 29 additions and 0 deletions

View file

@ -125,6 +125,17 @@ FOREACH(T ${LEANRUNTESTS})
endif()
ENDFOREACH(T)
# LEAN FAIL TESTS
file(GLOB LEANRUNTESTS "${LEAN_SOURCE_DIR}/../tests/lean/fail/*.lean")
FOREACH(T ${LEANRUNTESTS})
if(NOT T MATCHES "\\.#")
GET_FILENAME_COMPONENT(T_NAME ${T} NAME)
add_test(NAME "leanfailtest_${T_NAME}"
WORKING_DIRECTORY "${LEAN_SOURCE_DIR}/../tests/lean/fail"
COMMAND bash "./test_single.sh" "${CMAKE_CURRENT_BINARY_DIR}/lean" ${T_NAME})
endif()
ENDFOREACH(T)
# SMT2 RUN TESTS
# file(GLOB SMT2RUNTESTS "${LEAN_SOURCE_DIR}/../tests/lean/smt2/run/*.smt2")
# FOREACH(T ${SMT2RUNTESTS})

View file

@ -0,0 +1 @@
lemma wrong : false := by tactic.failed

View file

@ -0,0 +1 @@
lemma

View file

@ -0,0 +1,16 @@
#!/usr/bin/env bash
if [ $# -ne 2 ]; then
echo "Usage: test_single.sh [lean-executable-path] [file]"
exit 1
fi
ulimit -s 8192
LEAN=$1
export LEAN_PATH=../../../library:.
f=$2
echo "-- testing $f"
if "$LEAN" -j 0 "$f"; then
echo "failed $f"
exit 1
else
echo "-- checked"
fi