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. ...@@ -151,7 +151,9 @@ spot/ Sources for libspot.
sanity/ Sanity tests for the whole project. sanity/ Sanity tests for the whole project.
bin/ Command-line tools built on top of libspot. bin/ Command-line tools built on top of libspot.
man/ Man pages for the above tools. 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. doc/ Documentation for Spot.
org/ Source of userdoc/ as org-mode files. org/ Source of userdoc/ as org-mode files.
tl/ Documentation of the Temporal Logic operators. tl/ Documentation of the Temporal Logic operators.
...@@ -167,7 +169,6 @@ bench/ Benchmarks for ... ...@@ -167,7 +169,6 @@ bench/ Benchmarks for ...
stutter/ ... stutter-invariance checking algorithms, stutter/ ... stutter-invariance checking algorithms,
wdba/ ... WDBA minimization (for obligation properties). wdba/ ... WDBA minimization (for obligation properties).
python/ Python bindings for Spot and BuDDy python/ Python bindings for Spot and BuDDy
tests/ Tests for these bindings
ajax/ LTL-to-TGBA translator with web interface, using Javascript. ajax/ LTL-to-TGBA translator with web interface, using Javascript.
Third party software Third party software
......
...@@ -219,14 +219,13 @@ AC_CONFIG_FILES([ ...@@ -219,14 +219,13 @@ AC_CONFIG_FILES([
spot/twa/Makefile spot/twa/Makefile
python/ajax/Makefile python/ajax/Makefile
python/Makefile python/Makefile
python/tests/Makefile tests/core/defs
tests/defs
tests/Makefile tests/Makefile
tools/x-to-1 tools/x-to-1
]) ])
AC_CONFIG_FILES([doc/org/g++wrap], [chmod +x doc/org/g++wrap]) 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([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 AC_OUTPUT
case $VERSION:$enable_devel in case $VERSION:$enable_devel in
......
python/tests/*.ipynb tests/python/*.ipynb
python/tests/*.html tests/python/*.html
...@@ -84,8 +84,8 @@ override_dh_python3: ...@@ -84,8 +84,8 @@ override_dh_python3:
dh_python3 -p python3-spot dh_python3 -p python3-spot
override_dh_auto_build: override_dh_auto_build:
dh_auto_build dh_auto_build
$(MAKE) -C python/tests nb-html $(MAKE) -C tests/python nb-html
fix-mathjax: 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|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++. ...@@ -30,7 +30,7 @@ three interfaces supported by Spot: shell commands, Python, or C++.
* Examples in Python only * 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, collection of IPython notebooks. As the name of the directory implies,
these are part of the test suite for the Python bindings, however they 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. can be interesting to look at if you want to see more code examples.
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
## You should have received a copy of the GNU General Public License ## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>. ## 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) \ AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_builddir) -I$(top_srcdir) \
$(BUDDY_CPPFLAGS) -DSWIG_TYPE_TABLE=spot $(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 ...@@ -42,11 +42,11 @@ check_SCRIPTS = defs
TESTS = check.test finite.test finite2.test kripke.test TESTS = check.test finite.test finite2.test kripke.test
EXTRA_DIST = $(TESTS) beem-peterson.4.dve finite.dve finite.pm 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 && \ cd $(top_builddir)/tests && \
$(MAKE) $(AM_MAKEFLAGS) parse_print$(EXEEXT) $(MAKE) $(AM_MAKEFLAGS) core/parse_print$(EXEEXT)
distclean-local: distclean-local:
rm -rf $(TESTS:.test=.dir) rm -rf $(TESTS:.test=.dir)
...@@ -34,9 +34,9 @@ fi ...@@ -34,9 +34,9 @@ fi
set -e set -e
run 0 ../modelcheck -gK $srcdir/finite.dve 'F("P.a > 5")' > output 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 tr -d '"' < output >outputF
cmp outputF output2 cmp outputF output2
../modelcheck -gK $srcdir/beem-peterson.4.dve '!G("pos[1] < 3")' > outputP ../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} || "../../"; ...@@ -33,7 +33,7 @@ my $top_srcdir = $ENV{top_srcdir} || "../../";
my $top_srcdir_len = length($top_srcdir) + 1; my $top_srcdir_len = length($top_srcdir) + 1;
my $tut = "$top_srcdir/doc/org/tut.org"; my $tut = "$top_srcdir/doc/org/tut.org";
my $dir = "$top_srcdir/python/tests"; my $dir = "$top_srcdir/tests/python";
unless (-f $tut) unless (-f $tut)
{ {
print STDERR "$tut not found"; print STDERR "$tut not found";
...@@ -58,10 +58,10 @@ while (<FD>) ...@@ -58,10 +58,10 @@ while (<FD>)
} }
close(FD); close(FD);
open(FD, "$dir/Makefile.am") or die $!; open(FD, "$dir/../Makefile.am") or die "$!";
while (<FD>) while (<FD>)
{ {
if (m:\s([\w-]+\.ipynb):) if (m:python/([\w-]+\.ipynb):)
{ {
# print "$1 exist"; # print "$1 exist";
unless (exists $seen{$1}) unless (exists $seen{$1})
......
acc *.dir
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
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 @@ ...@@ -23,10 +23,10 @@
set -e set -e
../../bin/ltl2tgba -H 'GFa & GFb' > in ltl2tgba -H 'GFa & GFb' > in
grep 'Acceptance:' in > expected grep 'Acceptance:' in > expected
../../bin/ltl2tgba -H 'GFa & GFb' --stats='Acceptance: %a %g' > out1 ltl2tgba -H 'GFa & GFb' --stats='Acceptance: %a %g' > out1
../../bin/autfilt -H in --stats='Acceptance: %A %G' > out2 autfilt -H in --stats='Acceptance: %A %G' > out2
diff out1 expected diff out1 expected
diff out2 expected diff out2 expected
...@@ -64,7 +64,7 @@ EOF ...@@ -64,7 +64,7 @@ EOF
while IFS=, read a b while IFS=, read a b
do do
(cat header; echo 'Acceptance:' $a; cat body) | (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 done < acceptances > output
diff acceptances output diff acceptances output
...@@ -86,7 +86,7 @@ EOF ...@@ -86,7 +86,7 @@ EOF
while IFS=, read a b while IFS=, read a b
do do
(cat header; echo 'Acceptance:' $a; cat body) | (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 done < acceptances > output
diff acceptances output diff acceptances output
...@@ -109,7 +109,7 @@ EOF ...@@ -109,7 +109,7 @@ EOF
while IFS=, read a b while IFS=, read a b
do do
(cat header; echo 'Acceptance:' $a; cat body) | (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 done < acceptances > output
diff acceptances output diff acceptances output
...@@ -41,7 +41,7 @@ EOF ...@@ -41,7 +41,7 @@ EOF
ltl2tgba=../ikwiad ltl2tgba=../ikwiad
../../bin/ltlcross <formulae \ ltlcross <formulae \
"$ltl2tgba -t %f >%T" \ "$ltl2tgba -t %f >%T" \
"$ltl2tgba -N -r4 -R3f %f >%N" \ "$ltl2tgba -N -r4 -R3f %f >%N" \
"$ltl2tgba -N -r7 -R3 -x -Rm %f >%N" \ "$ltl2tgba -N -r7 -R3 -x -Rm %f >%N" \
......
...@@ -21,13 +21,13 @@ ...@@ -21,13 +21,13 @@
. ./defs . ./defs
set -e set -e
test "`../../bin/ltlfilt -p -f 'GFP_0.b_c'`" = "G(F(P_0.b_c))" test "`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" test "`ltlfilt -f 'GFP_0.b_c'`" = "GFP_0.b_c"
foo=`../../bin/ltlfilt -p -f 'GF"P_0.b_c"'` foo=`ltlfilt -p -f 'GF"P_0.b_c"'`
test "$foo" = "G(F(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)" 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" test "$foo" = "a.b U c.d.e"
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
set -e set -e
ltl2tgba=../../bin/ltl2tgba ltl2tgba=ltl2tgba
# This bug was found while working on the state-based acceptance # This bug was found while working on the state-based acceptance
...@@ -54,7 +54,7 @@ ltl2tgba=../../bin/ltl2tgba ...@@ -54,7 +54,7 @@ ltl2tgba=../../bin/ltl2tgba
# --spin -x ba-simul=2 # --spin -x ba-simul=2
# --spin -x ba-simul=3 # --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 '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 '((<> 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))))' \ -f '!p2 & (Fp5 R (((p0 U p1) & (p5 | p1)) | (!p5 & (!p0 R !p1))))' \
......
...@@ -22,9 +22,9 @@ ...@@ -22,9 +22,9 @@
set -e set -e
autfilt=../../bin/autfilt autfilt=autfilt
ltl2tgba=../../bin/ltl2tgba ltl2tgba=ltl2tgba
randaut=../../bin/randaut randaut=randaut
$randaut -H -A 'random 0..4' -Q1..10 -D -n 50 0..2 >aut $randaut -H -A 'random 0..4' -Q1..10 -D -n 50 0..2 >aut
run 0 $autfilt --complement -H aut >/dev/null run 0 $autfilt --complement -H aut >/dev/null
......
...@@ -66,4 +66,4 @@ run 0 ../complement -H -a x.hoa > nx.hoa ...@@ -66,4 +66,4 @@ run 0 ../complement -H -a x.hoa > nx.hoa
run 0 ../ikwiad -XH -e nx.hoa run 0 ../ikwiad -XH -e nx.hoa
# however the intersection of both should not # however the intersection of both should not
# accept any run. # 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 ...@@ -114,6 +114,6 @@ State: 1
--END-- --END--
EOF EOF
run 0 ../../bin/autfilt -CH automaton >out run 0 autfilt -CH automaton >out
cat out cat out
diff out expected diff out expected
...@@ -56,4 +56,4 @@ EOF ...@@ -56,4 +56,4 @@ EOF
# Check emptiness of product with complement. # Check emptiness of product with complement.
run 0 ../ikwiad -H -DC -C -XH input.hoa > output.hoa 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 ...@@ -58,14 +58,13 @@ case $srcdir in
esac esac
DOT='@DOT@' DOT='@DOT@'
top_builddir='../@top_builddir@'
LBTT="@LBTT@" LBTT="@LBTT@"
LBTT_TRANSLATE="@LBTT_TRANSLATE@" LBTT_TRANSLATE="@LBTT_TRANSLATE@"
VALGRIND='@VALGRIND@' VALGRIND='@VALGRIND@'