spot/tests/core/serial.test
Alexandre Duret-Lutz 61b457a37e bin: allow %l to be used to print serial numbers
* NEWS: Mention it.
* bin/autfilt.cc, bin/common_aoutput.cc, bin/common_aoutput.hh,
bin/common_output.cc, bin/common_output.hh, bin/dstar2tgba.cc,
bin/genaut.cc, bin/genltl.cc, bin/ltl2tgba.cc, bin/ltldo.cc,
bin/ltlfilt.cc, bin/ltlgrind.cc, bin/randaut.cc, bin/randltl.cc:
Implement it.
* doc/org/oaut.org: Add a short example.
* tests/core/serial.test: New file.
* tests/Makefile.am: Add it.
2023-07-21 17:16:19 +02:00

71 lines
1.8 KiB
Bash
Executable file

#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2023 Laboratoire de Recherche et
# Développement de l'Epita (LRDE).
#
# 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/>.
. ./defs
set -e
# all tools should be able to use %l as serial number for their output
# Make sure serial numbers count the output automata
randaut -n10 --name='aut %l' 2 |
autfilt -N3..5 --name='%M/out %l' |
autfilt --stats=%M >out
cat >exp <<EOF
aut 2/out 0
aut 3/out 1
aut 4/out 2
EOF
diff out exp
# Create different files
randaut -n3 2 -oaut-%l.hoa
test -f aut-0.hoa
test -f aut-1.hoa
test -f aut-2.hoa
# Split an output
cat aut-0.hoa aut-1.hoa aut-2.hoa > aut.hoa
rm aut-?.hoa
autfilt aut.hoa -o aut-%l.hoa
# check serial output in various tools
genaut --m-nba=2..3 --name='%F=%L/%l' | autfilt --stats=%M >out
genltl --and-f=2..3 --stats=%F=%L/%l >> out
ltl2tgba a b --name=%f/%l | autfilt --stats=%M >> out
ltldo -f a -f b ltl2tgba --name=%f/%l | autfilt --stats=%M >> out
genltl --or-g=2..5 --stats=%L,%l,%f |
ltlfilt -F -/3 -N 2..3 --stats='%<,%l' >>out
randltl -n10 3 --stats=%l,%f |
ltlfilt -F -/2 -N 2..3 --stats='%<,%l' >> out
cat >exp<<EOF
m-nba=2/0
m-nba=3/1
and-f=2/0
and-f=3/1
a/0
b/1
a/0
b/1
3,1,0
4,2,1
1,0
2,1
EOF
diff -u out exp