bin: factor output options of autfilt and randaut

* src/bin/autfilt.cc: Move output options handling...
* src/bin/common_aoutput.cc, src/bin/common_aoutput.hh:... here.
* src/bin/randaut.cc: Use them.
* src/tgbatest/randaut.test: Test --name and --stats for randaut.
This commit is contained in:
Alexandre Duret-Lutz 2015-01-02 20:40:24 +01:00
parent 3f4b19142d
commit 72737dfefc
5 changed files with 329 additions and 265 deletions

View file

@ -1,7 +1,7 @@
#!/bin/sh
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Laboratoire de Recherche et Développement de
# l'Epita (LRDE).
# Copyright (C) 2014, 2015 Laboratoire de Recherche et Développement
# de l'Epita (LRDE).
#
# This file is part of Spot, a model checking library.
#
@ -52,3 +52,19 @@ $randaut --states 10..20 2 -n 100 -H > aut.hoa
a=`$autfilt --states=..14 -c <aut.hoa`
b=`$autfilt aut.hoa --states=15.. -c`
test `expr $a + $b` = 100
# The count of SCCs and edges might change if the
# algorithm or its default values are changed. Do
# not hesitate to adjust the expected values below.
$randaut -n 5 --name='%F-%L-%s-%c-%e' -H a | grep '^name' >out
cat >expected<<EOF
name: "0-0-10-1-29"
name: "0-1-10-1-30"
name: "0-2-10-1-29"
name: "0-3-10-3-24"
name: "0-4-10-1-29"
EOF
diff out expected
$randaut -n 5 --stats='name: "%F-%L-%s-%c-%e"' a >out2
diff out2 expected