tests: divide the run time of parse.test by 20

* tests/core/readltl.cc: Process many formulas from a
file instead of one arg at a time.
* tests/core/parse.test, tests/core/parseerr.test, tests/core/utf8.test:
Adjust to supply a file as input.
This commit is contained in:
Alexandre Duret-Lutz 2016-11-29 11:51:34 +01:00
parent ad51525608
commit 7e5b336f16
4 changed files with 160 additions and 170 deletions

View file

@ -1,7 +1,7 @@
#! /bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2009, 2010, 2011, 2013, 2014, 2015 Laboratoire de
# Recherche et Développement de l'Epita (LRDE).
# Copyright (C) 2009, 2010, 2011, 2013, 2014, 2015, 2016 Laboratoire
# de Recherche et Développement de l'Epita (LRDE).
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
# et Marie Curie.
@ -28,42 +28,54 @@
. ./defs || exit 1
set -e
check()
{
set +x; run 1 ../ltl2text "$1" >stdout 2>stderr; set -x
if test -n "$2"; then
echo "$2" >expect
else
: >expect
fi
if cmp stdout expect; then
:
else
echo "'$1' parsed as"
cat stdout
echo "instead of"
cat expect
exit 1
fi
cat >input <<EOF
if test -n "$3"; then
echo "$3" >expect
if cmp stderr expect; then
:
else
echo "==== Error output was ===="
cat stderr
echo "==== instead of ===="
cat expect
exit 1
fi
fi
}
+
/2/3/4/5 a + b /6/7/8/
a - b
{a[*9999999999]}
EOF
# Empty or unparsable strings
check '' ''
check '+' ''
check '/2/3/4/5 a + b /6/7/8/' ''
run 1 ../ltl2text input >output
sed 's/$$//' >expected<<\EOF
>>> $
^
empty input
>>> +
^
syntax error, unexpected or operator
>>> +
^
ignoring trailing garbage
>>> /2/3/4/5 a + b /6/7/8/
^
syntax error, unexpected $undefined
>>> /2/3/4/5 a + b /6/7/8/
^^^^^^^^^^^^^^^^^^^^^^
ignoring trailing garbage
>>> a - b
^
syntax error, unexpected $undefined
>>> a - b
^^^
ignoring trailing garbage
ap(@3 #0 "a")
>>> {a[*9999999999]}
^^^^^^^^^^
value too large ignored
Closure(@6 #0 [Star(@5 #0 0.. [ap(@4 #0 "a")])])
EOF
diff output expected
cat >recover.txt <<EOF
@ -95,18 +107,3 @@ a & (, a & 0
{a[->..0];b}, {a[->0..1];b}
EOF
run 0 ../equals -E recover.txt
check 'a - b' 'ap(@3 #0 "a")' '>>> a - b
^
syntax error, unexpected $undefined
>>> a - b
^^^
ignoring trailing garbage
'
check '{a[*9999999999]}' 'Closure(@5 #0 [Star(@4 #0 0.. [ap(@3 #0 "a")])])' \
'>>> {a[*9999999999]}
^^^^^^^^^^
value too large ignored
'