ltlcross: Display the number of timeouts.

* NEWS: Mention it.
* src/bin/ltlcross.cc: Always display the number of timeout
on normal termination.
This commit is contained in:
Alexandre Duret-Lutz 2013-01-18 23:28:30 +01:00
parent c5461335c9
commit 5086e24165
2 changed files with 23 additions and 6 deletions

2
NEWS
View file

@ -19,6 +19,8 @@ New in spot 1.0a (not released):
FG(a&Gb) = FG(a&b)
- The on-line version of ltl2tgba now displays edge and
transition counts, just as the ltlcross tool.
- ltlcross will display the number of timeouts at the end
of its execution.
* Pruning:
- lbtt has been removed from the distribution. A copy of the last
version we distributed is still available at

View file

@ -323,6 +323,7 @@ create_tmpfile(char c, unsigned int n, std::string& name)
static volatile bool timed_out = false;
unsigned timeout_count = 0;
#if ENABLE_TIMEOUT
static volatile int alarm_on = 0;
@ -575,6 +576,7 @@ namespace
{
// This is not considered to be a global error.
std::cerr << "warning: timeout during execution of command\n";
++timeout_count;
}
else if (WIFSIGNALED(es))
{
@ -1108,12 +1110,25 @@ main(int argc, char** argv)
else
{
if (global_error_flag)
std::cerr
<< ("error: some error was detected during the above runs,\n"
" please search for 'error:' messages in the above trace.")
<< std::endl;
else
std::cerr << "no problem detected" << std::endl;
{
std::cerr
<< ("error: some error was detected during the above runs,\n"
" please search for 'error:' messages in the above "
"trace.")
<< std::endl;
if (timeout_count == 1)
std::cerr << "Additionally, 1 timeout occurred." << std::endl;
else if (timeout_count > 1)
std::cerr << "Additionally, "
<< timeout_count << " timeouts occurred." << std::endl;
}
else if (timeout_count == 0)
std::cerr << "No problem detected." << std::endl;
else if (timeout_count == 1)
std::cerr << "1 timeout, but no other problem detected." << std::endl;
else
std::cerr << timeout_count
<< " timeouts, but no other problem detected." << std::endl;
}
if (json_output)