From a33c1894c37651ff0eed235a198149f70d56187d Mon Sep 17 00:00:00 2001 From: Guillaume Sadegh Date: Tue, 10 Jun 2008 03:34:40 +0200 Subject: [PATCH] Test suite for the NipsVM front-end. 2008-06-02 Guillaume SADEGH * iface/nips/nipstest/Makefile.am, iface/nips/Makefile.am, configure.ac, iface/nips/nipstest/emptiness.test, iface/nips/nipstest/dotty.test: Test suite for the NipsVM front-end. * iface/nips/emptiness_check.cc, iface/nips/dottynips.cc: `catch' don't throw anymore an exception, but exit with 1. * iface/nips/common.cc, iface/nips/nips.cc (nips_interface): Change messages of nips_exception. --- ChangeLog | 13 +++++++++++++ configure.ac | 8 +++++--- iface/nips/Makefile.am | 2 +- iface/nips/common.cc | 4 ++-- iface/nips/dottynips.cc | 2 +- iface/nips/emptiness_check.cc | 2 +- iface/nips/nips.cc | 5 +++-- 7 files changed, 26 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9814a1edc..ef0a7b857 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-06-02 Guillaume SADEGH + + Test suite for the NipsVM front-end. + + * iface/nips/nipstest/Makefile.am, iface/nips/Makefile.am, + configure.ac, iface/nips/nipstest/emptiness.test, + iface/nips/nipstest/dotty.test: Test suite for the NipsVM + front-end. + * iface/nips/emptiness_check.cc, iface/nips/dottynips.cc: `catch' + don't throw anymore an exception, but exit with 1. + * iface/nips/common.cc, iface/nips/nips.cc (nips_interface): + Change messages of nips_exception. + 2008-06-03 Alexandre Duret-Lutz * src/sanity/includes.test (INCDIR): Remove any trailing slash. diff --git a/configure.ac b/configure.ac index cf82908ba..62427ec39 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ -# Copyright (C) 2003, 2004, 2005, 2006, 2007 Laboratoire d'Informatique -# de Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC), -# Université Pierre et Marie Curie. +# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Laboratoire +# d'Informatique de Paris 6 (LIP6), département Systèmes Répartis +# Coopératifs (SRC), Université Pierre et Marie Curie. # # This file is part of Spot, a model checking library. # @@ -80,6 +80,8 @@ AC_CONFIG_FILES([ iface/gspn/defs iface/nips/Makefile iface/nips/nips_vm/Makefile + iface/nips/nipstest/Makefile + iface/nips/nipstest/defs src/Makefile src/eltlast/Makefile src/eltlenv/Makefile diff --git a/iface/nips/Makefile.am b/iface/nips/Makefile.am index 57bc5ac54..04790e076 100644 --- a/iface/nips/Makefile.am +++ b/iface/nips/Makefile.am @@ -43,4 +43,4 @@ dottynips_LDADD = libspotnips.la empt_check_SOURCES = emptiness_check.cc empt_check_LDADD = libspotnips.la -SUBDIRS = nips_vm +SUBDIRS = nips_vm nipstest diff --git a/iface/nips/common.cc b/iface/nips/common.cc index 51499e13c..266faa7b3 100644 --- a/iface/nips/common.cc +++ b/iface/nips/common.cc @@ -29,9 +29,9 @@ namespace spot operator<<(std::ostream& os, const nips_exception& e) { if (e.get_err_defined()) - os << e.get_where() << " exited with " << e.get_err(); + os << e.get_where() << " with exit value: " << e.get_err(); else - os << e.get_where() << " with no exit value"; + os << e.get_where(); return os; } diff --git a/iface/nips/dottynips.cc b/iface/nips/dottynips.cc index 598f298d1..48df1d9e8 100644 --- a/iface/nips/dottynips.cc +++ b/iface/nips/dottynips.cc @@ -44,5 +44,5 @@ main(int argc, char **argv) catch (spot::nips_exception& e) { std::cerr << e << std::endl; - throw; + return 1; } diff --git a/iface/nips/emptiness_check.cc b/iface/nips/emptiness_check.cc index 9cfb12493..bd492ab74 100644 --- a/iface/nips/emptiness_check.cc +++ b/iface/nips/emptiness_check.cc @@ -124,6 +124,6 @@ main(int argc, char **argv) catch (spot::nips_exception& e) { std::cerr << e << std::endl; - throw; + return 1; } diff --git a/iface/nips/nips.cc b/iface/nips/nips.cc index d7f0cbc0b..3f53b17c1 100644 --- a/iface/nips/nips.cc +++ b/iface/nips/nips.cc @@ -384,14 +384,15 @@ namespace spot bytecode_ = bytecode_load_from_file(filename.c_str(), 0); if (bytecode_ == 0) - throw nips_exception("bytecode_load_from_file()"); + throw nips_exception("Unable to open `" + filename + + "' as a NIPS bytecode."); nipsvm_ = new nipsvm_t(); int res = nipsvm_init(nipsvm_, bytecode_, successor_state_callback, search_error_callback); if (res != 0) - throw nips_exception("nipsvm_init()", res); + throw nips_exception("Error while initializing the NIPS VM", res); } nips_interface::~nips_interface()