* tests/core/bdddict.cc: Trap SIGABORT so coverage works.
This commit is contained in:
parent
ba5a89a620
commit
d9f8c517fa
1 changed files with 30 additions and 0 deletions
|
|
@ -17,12 +17,42 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#include <signal.h>
|
||||
#include <iostream>
|
||||
#include <spot/tl/parse.hh>
|
||||
#include <spot/twaalgos/translate.hh>
|
||||
|
||||
// assert_emptiness() calls abort() which prevents gcov from flushing
|
||||
// its coverage data. So we convert SIGABRT as exit(1) whenever
|
||||
// possible.
|
||||
#if HAVE_SIGACTION
|
||||
static void
|
||||
sig_handler(int)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
|
||||
static void
|
||||
setup_sig_handler()
|
||||
{
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = sig_handler;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sigaction(SIGABRT, &sa, nullptr);
|
||||
}
|
||||
#else
|
||||
static void
|
||||
setup_sig_handler()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
setup_sig_handler();
|
||||
spot::formula f = spot::parse_formula("& & G p0 p1 p2");
|
||||
spot::translator trans;
|
||||
spot::twa_graph_ptr aut = trans.run(f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue