ltl2tgba, randaut: better error reporting
* src/bin/ltl2tgba.cc, src/bin/randaut.cc: Catch exceptions in main loop. * src/tgbatest/ltl2tgba.test, src/tgbatest/randaut.test: Test errors with unknown --dot argument.
This commit is contained in:
parent
5497bef3d0
commit
4d4c5d807b
4 changed files with 28 additions and 7 deletions
|
|
@ -60,7 +60,7 @@ static const argp_option options[] =
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
{ "%f", 0, 0, OPTION_DOC | OPTION_NO_USAGE,
|
{ "%f", 0, 0, OPTION_DOC | OPTION_NO_USAGE,
|
||||||
"the formula, in Spot's syntax", 4 },
|
"the formula, in Spot's syntax", 4 },
|
||||||
/**************************************************/
|
/**************************************************/
|
||||||
{ 0, 0, 0, 0, "Miscellaneous options:", -1 },
|
{ 0, 0, 0, 0, "Miscellaneous options:", -1 },
|
||||||
{ "extra-options", 'x', "OPTS", 0,
|
{ "extra-options", 'x', "OPTS", 0,
|
||||||
"fine-tuning options (see spot-x (7))", 0 },
|
"fine-tuning options (see spot-x (7))", 0 },
|
||||||
|
|
@ -182,7 +182,14 @@ main(int argc, char** argv)
|
||||||
trans.set_level(level);
|
trans.set_level(level);
|
||||||
|
|
||||||
trans_processor processor(trans);
|
trans_processor processor(trans);
|
||||||
if (processor.run())
|
try
|
||||||
return 2;
|
{
|
||||||
|
if (processor.run())
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
catch (const std::runtime_error& e)
|
||||||
|
{
|
||||||
|
error(2, 0, "%s", e.what());
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -298,8 +298,15 @@ main(int argc, char** argv)
|
||||||
|
|
||||||
auto runtime = sw.stop();
|
auto runtime = sw.stop();
|
||||||
|
|
||||||
printer.print(aut, nullptr,
|
try
|
||||||
opt_seed_str, automaton_num, runtime, nullptr);
|
{
|
||||||
|
printer.print(aut, nullptr,
|
||||||
|
opt_seed_str, automaton_num, runtime, nullptr);
|
||||||
|
}
|
||||||
|
catch (const std::runtime_error& e)
|
||||||
|
{
|
||||||
|
error(2, 0, "%s", e.what());
|
||||||
|
}
|
||||||
|
|
||||||
++automaton_num;
|
++automaton_num;
|
||||||
if (opt_automata > 0 && automaton_num >= opt_automata)
|
if (opt_automata > 0 && automaton_num >= opt_automata)
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche et
|
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Laboratoire
|
||||||
# Développement de l'Epita (LRDE).
|
# de Recherche et Développement de l'Epita (LRDE).
|
||||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
# et Marie Curie.
|
# et Marie Curie.
|
||||||
|
|
@ -201,3 +201,7 @@ grep 'states: 4$' stdout
|
||||||
../../bin/ltlfilt -r -f '!{{a;b}[*]}' --equivalent-to '!a | X!b'
|
../../bin/ltlfilt -r -f '!{{a;b}[*]}' --equivalent-to '!a | X!b'
|
||||||
../../bin/ltlfilt -f '{a[*];b[*]}' --equivalent-to 'a | b'
|
../../bin/ltlfilt -f '{a[*];b[*]}' --equivalent-to 'a | b'
|
||||||
../../bin/ltlfilt -r -f '{a[*];b[*]}' --equivalent-to 'a | b'
|
../../bin/ltlfilt -r -f '{a[*];b[*]}' --equivalent-to 'a | b'
|
||||||
|
|
||||||
|
# test unknown dot options
|
||||||
|
../../bin/ltl2tgba --dot=@ a 2>stderr && exit 1
|
||||||
|
grep 'ltl2tgba: unknown option.*@' stderr
|
||||||
|
|
|
||||||
|
|
@ -68,3 +68,6 @@ diff out expected
|
||||||
|
|
||||||
$randaut -n 5 --stats='name: "%F-%L-%s-%c-%e"' a >out2
|
$randaut -n 5 --stats='name: "%F-%L-%s-%c-%e"' a >out2
|
||||||
diff out2 expected
|
diff out2 expected
|
||||||
|
|
||||||
|
$randaut -n 5 --dot=@ a 2>stderr && exit 1
|
||||||
|
grep 'randaut: unknown option.*@' stderr
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue