Commit 5cb94a1a authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

Merge the core and python tests in the tests/ directory

* tests/: Rename as...
* tests/core/: ... this.
* python/tests/: Rename as...
* tests/python/: ... this.
* python/tests/run.in: Move as...
* tests/run.in: This, and adjust.
* tests/Makefile.am: Adjust to run both core and python tests.
* configure.ac, README, debian/python3-spot.examples, debian/rules,
doc/org/tut.org, python/Makefile.am, spot/ltsmin/Makefile.am,
spot/ltsmin/kripke.test, spot/sanity/ipynb.test: Adjust.
parent 18572db3
......@@ -151,7 +151,9 @@ spot/ Sources for libspot.
sanity/ Sanity tests for the whole project.
bin/ Command-line tools built on top of libspot.
man/ Man pages for the above tools.
tests/ Tests for libspot and the binaries.
tests/ Test suite
core/ Tests for libspot and the binaries.
python/ Tests for Python bindings.
doc/ Documentation for Spot.
org/ Source of userdoc/ as org-mode files.
tl/ Documentation of the Temporal Logic operators.
......@@ -167,7 +169,6 @@ bench/ Benchmarks for ...
stutter/ ... stutter-invariance checking algorithms,
wdba/ ... WDBA minimization (for obligation properties).
python/ Python bindings for Spot and BuDDy
tests/ Tests for these bindings
ajax/ LTL-to-TGBA translator with web interface, using Javascript.
Third party software
......
......@@ -219,14 +219,13 @@ AC_CONFIG_FILES([
spot/twa/Makefile
python/ajax/Makefile
python/Makefile
python/tests/Makefile
tests/defs
tests/core/defs
tests/Makefile
tools/x-to-1
])
AC_CONFIG_FILES([doc/org/g++wrap], [chmod +x doc/org/g++wrap])
AC_CONFIG_FILES([doc/dot], [chmod +x doc/dot])
AC_CONFIG_FILES([python/tests/run], [chmod +x python/tests/run])
AC_CONFIG_FILES([tests/run], [chmod +x tests/run])
AC_OUTPUT
case $VERSION:$enable_devel in
......
python/tests/*.ipynb
python/tests/*.html
tests/python/*.ipynb
tests/python/*.html
......@@ -84,8 +84,8 @@ override_dh_python3:
dh_python3 -p python3-spot
override_dh_auto_build:
dh_auto_build
$(MAKE) -C python/tests nb-html
$(MAKE) -C tests/python nb-html
fix-mathjax:
perl -pi -e 's|http://orgmode.org/mathjax/MathJax.js|file:///usr/share/javascript/mathjax/MathJax.js|' doc/userdoc/*.html
perl -pi -e 's|https://cdn.mathjax.org/mathjax/latest/MathJax.js|file:///usr/share/javascript/mathjax/MathJax.js|' python/tests/*.html
perl -pi -e 's|https://cdn.mathjax.org/mathjax/latest/MathJax.js|file:///usr/share/javascript/mathjax/MathJax.js|' tests/python/*.html
......@@ -30,7 +30,7 @@ three interfaces supported by Spot: shell commands, Python, or C++.
* Examples in Python only
In directory =python/tests=, the [[file:install.org][Spot tarball]] contains a small
In directory the, =python/tests= [[file:install.org][Spot tarball]] contains a small
collection of IPython notebooks. As the name of the directory implies,
these are part of the test suite for the Python bindings, however they
can be interesting to look at if you want to see more code examples.
......
......@@ -20,7 +20,7 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
SUBDIRS = . ajax tests
SUBDIRS = . ajax
AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_builddir) -I$(top_srcdir) \
$(BUDDY_CPPFLAGS) -DSWIG_TYPE_TABLE=spot
......
## -*- coding: utf-8 -*-
## Copyright (C) 2010, 2012, 2013, 2014, 2015 Labortatoire de
## Recherche et Développement de l'EPITA.
## Copyright (C) 2003, 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
## département Systèmes Répartis Coopératifs (SRC), Université Pierre
## et Marie Curie.
##
## This file is part of Spot, a model checking library.
##
## Spot is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## Spot is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
## License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST = \
$(TESTS) \
ltl2tgba.py \
ipnbdoctest.py
LOG_COMPILER = ./run
LOG_DRIVER = $(TEST_LOG_DRIVER)
# ensure run is rebuilt before the tests are run.
check_SCRIPTS = run
TESTS = \
acc_cond.ipynb \
accparse.ipynb \
accparse2.py \
alarm.py \
automata.ipynb \
automata-io.ipynb \
bddnqueen.py \
decompose.ipynb \
formulas.ipynb \
implies.py \
interdep.py \
ltl2tgba.test \
ltlparse.py \
ltlsimple.py \
minato.py \
optionmap.py \
parsetgba.py \
piperead.ipynb \
product.ipynb \
randaut.ipynb \
randgen.py \
randltl.ipynb \
relabel.py \
remfin.py \
satmin.py \
setxor.py \
testingaut.ipynb
SUFFIXES = .ipynb .html
.ipynb.html:
$(IPYTHON) nbconvert $< --to html
.PHONY: nb-html
nb-html: $(TESTS:.ipynb=.html)
......@@ -42,11 +42,11 @@ check_SCRIPTS = defs
TESTS = check.test finite.test finite2.test kripke.test
EXTRA_DIST = $(TESTS) beem-peterson.4.dve finite.dve finite.pm
kripke.test: $(top_builddir)/tests/parse_print$(EXEEXT)
kripke.test: $(top_builddir)/tests/core/parse_print$(EXEEXT)
$(top_builddir)/tests/parse_print$(EXEEXT):
$(top_builddir)/tests/core/parse_print$(EXEEXT):
cd $(top_builddir)/tests && \
$(MAKE) $(AM_MAKEFLAGS) parse_print$(EXEEXT)
$(MAKE) $(AM_MAKEFLAGS) core/parse_print$(EXEEXT)
distclean-local:
rm -rf $(TESTS:.test=.dir)
......@@ -34,9 +34,9 @@ fi
set -e
run 0 ../modelcheck -gK $srcdir/finite.dve 'F("P.a > 5")' > output
run 0 $top_builddir/tests/parse_print output | tr -d '"' > output2
run 0 $top_builddir/tests/core/parse_print output | tr -d '"' > output2
tr -d '"' < output >outputF
cmp outputF output2
../modelcheck -gK $srcdir/beem-peterson.4.dve '!G("pos[1] < 3")' > outputP
$top_builddir/tests/ikwiad -e -KPoutputP '!G("pos[1] < 3")'
$top_builddir/tests/core/ikwiad -e -KPoutputP '!G("pos[1] < 3")'
......@@ -33,7 +33,7 @@ my $top_srcdir = $ENV{top_srcdir} || "../../";
my $top_srcdir_len = length($top_srcdir) + 1;
my $tut = "$top_srcdir/doc/org/tut.org";
my $dir = "$top_srcdir/python/tests";
my $dir = "$top_srcdir/tests/python";
unless (-f $tut)
{
print STDERR "$tut not found";
......@@ -58,10 +58,10 @@ while (<FD>)
}
close(FD);
open(FD, "$dir/Makefile.am") or die $!;
open(FD, "$dir/../Makefile.am") or die "$!";
while (<FD>)
{
if (m:\s([\w-]+\.ipynb):)
if (m:python/([\w-]+\.ipynb):)
{
# print "$1 exist";
unless (exists $seen{$1})
......
acc
apcollect
bddprod
bitvect
blue_counter
checkpsl
checkta
complement
consterm
defs
.deps
*.dot
eltl2tgba
emptchk
defs
equals
expect
expldot
explicit
explicit2
explicit3
explprod
graph
genltl
input
intvcomp
intvcmp2
kind
length
.libs
ikwiad
ltl2dot
ltl2text
ltlmagic
ltlprod
ltlrel
lunabbrev
Makefile
Makefile.in
maskacc
mixprod
nequals
nenoform
ngraph
output1
output2
parse_print
powerset
*.ps
randltl
randtgba
readsat
readsave
reduc
reduceu
reductau
reductaustr
reduccmp
reductgba
stdout
spotlbtt
syntimpl
taatgba
tgbagraph
tgbaread
tostring
tripprod
tunabbrev
tunenoform
unabbrevwm
*.dir
This diff is collapsed.
acc
apcollect
bddprod
bitvect
blue_counter
checkpsl
checkta
complement
consterm
defs
.deps
*.dot
eltl2tgba
emptchk
defs
equals
expect
expldot
explicit
explicit2
explicit3
explprod
graph
genltl
input
intvcomp
intvcmp2
kind
length
.libs
ikwiad
ltl2dot
ltl2text
ltlmagic
ltlprod
ltlrel
lunabbrev
Makefile
Makefile.in
maskacc
mixprod
nequals
nenoform
ngraph
output1
output2
parse_print
powerset
*.ps
randltl
randtgba
readsat
readsave
reduc
reduceu
reductau
reductaustr
reduccmp
reductgba
stdout
spotlbtt
syntimpl
taatgba
tgbagraph
tgbaread
tostring
tripprod
tunabbrev
tunenoform
unabbrevwm
......@@ -23,10 +23,10 @@
set -e
../../bin/ltl2tgba -H 'GFa & GFb' > in
ltl2tgba -H 'GFa & GFb' > in
grep 'Acceptance:' in > expected
../../bin/ltl2tgba -H 'GFa & GFb' --stats='Acceptance: %a %g' > out1
../../bin/autfilt -H in --stats='Acceptance: %A %G' > out2
ltl2tgba -H 'GFa & GFb' --stats='Acceptance: %a %g' > out1
autfilt -H in --stats='Acceptance: %A %G' > out2
diff out1 expected
diff out2 expected
......@@ -64,7 +64,7 @@ EOF
while IFS=, read a b
do
(cat header; echo 'Acceptance:' $a; cat body) |
../../bin/autfilt -H --dnf-acc --stats '%A %G, %a %g'
autfilt -H --dnf-acc --stats '%A %G, %a %g'
done < acceptances > output
diff acceptances output
......@@ -86,7 +86,7 @@ EOF
while IFS=, read a b
do
(cat header; echo 'Acceptance:' $a; cat body) |
../../bin/autfilt -H --cnf-acc --stats '%A %G, %a %g'
autfilt -H --cnf-acc --stats '%A %G, %a %g'
done < acceptances > output
diff acceptances output
......@@ -109,7 +109,7 @@ EOF
while IFS=, read a b
do
(cat header; echo 'Acceptance:' $a; cat body) |
../../bin/autfilt -H --complement-acc --stats '%A %G, %a %g'
autfilt -H --complement-acc --stats '%A %G, %a %g'
done < acceptances > output
diff acceptances output
......@@ -41,7 +41,7 @@ EOF
ltl2tgba=../ikwiad
../../bin/ltlcross <formulae \
ltlcross <formulae \
"$ltl2tgba -t %f >%T" \
"$ltl2tgba -N -r4 -R3f %f >%N" \
"$ltl2tgba -N -r7 -R3 -x -Rm %f >%N" \
......
......@@ -21,13 +21,13 @@
. ./defs
set -e
test "`../../bin/ltlfilt -p -f 'GFP_0.b_c'`" = "G(F(P_0.b_c))"
test "`../../bin/ltlfilt -f 'GFP_0.b_c'`" = "GFP_0.b_c"
foo=`../../bin/ltlfilt -p -f 'GF"P_0.b_c"'`
test "`ltlfilt -p -f 'GFP_0.b_c'`" = "G(F(P_0.b_c))"
test "`ltlfilt -f 'GFP_0.b_c'`" = "GFP_0.b_c"
foo=`ltlfilt -p -f 'GF"P_0.b_c"'`
test "$foo" = "G(F(P_0.b_c))"
foo=`../../bin/ltlfilt -p -f '"a.b" U c.d.e'`
foo=`ltlfilt -p -f '"a.b" U c.d.e'`
test "$foo" = "(a.b) U (c.d.e)"
foo=`../../bin/ltlfilt -f '"a.b" U c.d.e'`
foo=`ltlfilt -f '"a.b" U c.d.e'`
test "$foo" = "a.b U c.d.e"
......@@ -22,7 +22,7 @@
set -e
ltl2tgba=../../bin/ltl2tgba
ltl2tgba=ltl2tgba
# This bug was found while working on the state-based acceptance
......@@ -54,7 +54,7 @@ ltl2tgba=../../bin/ltl2tgba
# --spin -x ba-simul=2
# --spin -x ba-simul=3
../../bin/ltlcross --seed=0 --products=5 --json=out.json \
ltlcross --seed=0 --products=5 --json=out.json \
-f 'X((F(Xa | b) W c) U (Xc W (a & d)))' \
-f '((<> p5 V ((p0 U p1) <-> (p5 \/ p1))) -> ((<> p4 V p2) M p2))' \
-f '!p2 & (Fp5 R (((p0 U p1) & (p5 | p1)) | (!p5 & (!p0 R !p1))))' \
......
......@@ -22,9 +22,9 @@
set -e
autfilt=../../bin/autfilt
ltl2tgba=../../bin/ltl2tgba
randaut=../../bin/randaut
autfilt=autfilt
ltl2tgba=ltl2tgba
randaut=randaut
$randaut -H -A 'random 0..4' -Q1..10 -D -n 50 0..2 >aut
run 0 $autfilt --complement -H aut >/dev/null
......
......@@ -66,4 +66,4 @@ run 0 ../complement -H -a x.hoa > nx.hoa
run 0 ../ikwiad -XH -e nx.hoa
# however the intersection of both should not
# accept any run.
run 1 ../../bin/autfilt -q nx.hoa --intersect x.hoa
run 1 autfilt -q nx.hoa --intersect x.hoa
......@@ -114,6 +114,6 @@ State: 1
--END--
EOF
run 0 ../../bin/autfilt -CH automaton >out
run 0 autfilt -CH automaton >out
cat out
diff out expected
......@@ -56,4 +56,4 @@ EOF
# Check emptiness of product with complement.
run 0 ../ikwiad -H -DC -C -XH input.hoa > output.hoa
run 1 ../../bin/autfilt -q input.hoa --intersect output.hoa
run 1 autfilt -q input.hoa --intersect output.hoa
......@@ -58,14 +58,13 @@ case $srcdir in
esac
DOT='@DOT@'
top_builddir='../@top_builddir@'
LBTT="@LBTT@"
LBTT_TRANSLATE="@LBTT_TRANSLATE@"
VALGRIND='@VALGRIND@'
SPIN='@SPIN@'
LTL2BA='@LTL2BA@'
PYTHON='@PYTHON@'
top_srcdir='../@top_srcdir@'
top_srcdir='@abs_top_srcdir@'
# The test cases assume these variable are undefined
unset SPOT_DOTEXTRA
......@@ -83,9 +82,16 @@ run()
shift
exitcode=0
if test -n "$VALGRIND"; then
# Replace the command name by a full path after lookup in $PATH, so
# that valgrind will find it.
cmd=`command -v $1`
shift
test -n "$cmd" || exit 1
set $cmd "$@"
# Run valgrind.
exec 6>valgrind.err
GLIBCPP_FORCE_NEW=1 \
../../libtool --mode=execute \
GLIBCXX_FORCE_NEW=1 \
@abs_top_builddir@/libtool --mode=execute \
$VALGRIND --tool=memcheck --leak-check=yes --log-fd=6 -q "$@" ||
exitcode=$?
cat valgrind.err 1>&2
......
......@@ -133,7 +133,7 @@ grep 'states: 8' out
# This automaton should have a 3-state BA, but it's really
# easy to obtain a 4-state BA when tweaking the degeneralization
# to ignore arc entering an SCC.
test 3 = "`../../bin/ltl2tgba -B 'G(a|G(b|Fc))' --stats=%s`"
test 3 = "`ltl2tgba -B 'G(a|G(b|Fc))' --stats=%s`"
# This 7-state DRA (built with
......@@ -220,12 +220,12 @@ Acc-Sig:
0
EOF
run 0 ../../bin/dstar2tgba in.dra -BD --stats=%s > out.stat
run 0 dstar2tgba in.dra -BD --stats=%s > out.stat
test 5 = "`cat out.stat`"
# Only one state should be accepting. In spot 1.2.x an initial state
# in a trivial SCC was marked as accepting: this is superfluous.
../../bin/ltl2tgba -BH 'a & GFb & GFc' > out
ltl2tgba -BH 'a & GFb & GFc' > out
cat out
cat >expected<<EOF
HOA: v1
......
......@@ -25,11 +25,11 @@ set -e
# Make sure degen-skip=0 and degen-skip=1 produce the expected
# automata for 'GFa & GFb'
../../bin/ltl2tgba -B 'GFa & GFb' --hoa > out1
../../bin/ltl2tgba -B -x degen-lskip=1 'GFa & GFb' --hoa > out2
../../bin/ltl2tgba -B -x degen-lskip=0 'GFa & GFb' --hoa > out3
../../bin/ltl2tgba -B -x degen-lskip=1,degen-lowinit=1 'GFa & GFb' --hoa > out4
../../bin/ltl2tgba -B -x degen-lskip=0,degen-lowinit=1 'GFa & GFb' --hoa > out5
ltl2tgba -B 'GFa & GFb' --hoa > out1
ltl2tgba -B -x degen-lskip=1 'GFa & GFb' --hoa > out2
ltl2tgba -B -x degen-lskip=0 'GFa & GFb' --hoa > out3
ltl2tgba -B -x degen-lskip=1,degen-lowinit=1 'GFa & GFb' --hoa > out4
ltl2tgba -B -x degen-lskip=0,degen-lowinit=1 'GFa & GFb' --hoa > out5
diff out1 out2
cmp out2 out3 && exit 1
......@@ -122,13 +122,13 @@ State: 2
EOF
run 0 ../../bin/autfilt -q -F out2 --isomorph expected2
run 0 ../../bin/autfilt -q -F out3 --isomorph expected3
run 0 autfilt -q -F out2 --isomorph expected2
run 0 autfilt -q -F out3 --isomorph expected3
cat out4 out5
../../bin/autfilt -q out4 --isomorph expected2 && exit 1
../../bin/autfilt -q out5 --isomorph expected3 && exit 1
autfilt -q out4 --isomorph expected2 && exit 1
autfilt -q out5 --isomorph expected3 && exit 1
../../bin/autfilt -q out4 --isomorph expected4
../../bin/autfilt -q out5 --isomorph expected5
autfilt -q out4 --isomorph expected4
autfilt -q out5 --isomorph expected5
......@@ -21,7 +21,7 @@
. ./defs
set -e
ltl2tgba=../../bin/ltl2tgba
ltl2tgba=ltl2tgba
cat >formulas <<'EOF'
1,13,X((a M F((!b & !c) | (b & c))) W (G!c U b))
......@@ -111,8 +111,8 @@ State: 4 {0}
EOF
run 0 ../ikwiad -H -DC -XH in.hoa > out.hoa
run 1 ../../bin/autfilt -q --are-isomorph in.hoa out.hoa
run 0 ../../bin/autfilt -q --are-isomorph ex.hoa out.hoa
run 1 autfilt -q --are-isomorph in.hoa out.hoa
run 0 autfilt -q