Test suite for the NipsVM front-end.

2008-06-02  Guillaume SADEGH  <sadegh@lrde.epita.fr>

        * 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.
This commit is contained in:
Guillaume Sadegh 2008-06-10 03:34:40 +02:00
parent f56721107b
commit a33c1894c3
7 changed files with 26 additions and 10 deletions

View file

@ -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

View file

@ -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;
}

View file

@ -44,5 +44,5 @@ main(int argc, char **argv)
catch (spot::nips_exception& e)
{
std::cerr << e << std::endl;
throw;
return 1;
}

View file

@ -124,6 +124,6 @@ main(int argc, char **argv)
catch (spot::nips_exception& e)
{
std::cerr << e << std::endl;
throw;
return 1;
}

View file

@ -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()