* configure.ac: Output src/tgbatest/Makefile and src/tgbatest/defs.

* src/Makefile.am (SUBDIRS): Add tgbatest.
* src/tgba/tgbaexplicit.hh, src/tgba/tgbaexplicit.cc: New file.
* src/tgba/Makefile.am (libtgba_la_SOURCES): Add tgbaexplicit.cc
and tgbaexplicit.hh.
* src/tgbatest/Makefile.am, src/tgbatest/defs.in,
src/tgbatest/explicit.cc, src/tgbatest/explicit.test: New files.
This commit is contained in:
Alexandre Duret-Lutz 2003-06-05 12:15:03 +00:00
parent b8bb100521
commit 80dd0ae140
12 changed files with 417 additions and 4 deletions

6
src/tgbatest/.cvsignore Normal file
View file

@ -0,0 +1,6 @@
.deps
Makefile
Makefile.in
defs
explicit
.libs

16
src/tgbatest/Makefile.am Normal file
View file

@ -0,0 +1,16 @@
AM_CPPFLAGS = -I$(srcdir)/..
LDADD = ../libspot.la
check_SCRIPTS = defs
# Keep this sorted alphabetically.
check_PROGRAMS = \
explicit
explicit_SOURCES = explicit.cc
TESTS = \
explicit.test
EXTRA_DIST = $(TESTS)
CLEANFILES = stdout expected

35
src/tgbatest/defs.in Normal file
View file

@ -0,0 +1,35 @@
# -*- shell-script -*-
# Ensure we are running from the right directory.
test -f ./defs || {
echo "defs: not found in current directory" 1>&2
exit 1
}
# If srcdir is not set, then we are not running from `make check', be verbose.
if test -z "$srcdir"; then
test -z "$VERBOSE" && VERBOSE=x
# compute $srcdir.
srcdir=`echo "$0" | sed -e 's,/[^\\/]*$,,'`
test $srcdir = $0 && srcdir=.
fi
# Ensure $srcdir is set correctly.
test -f $srcdir/defs.in || {
echo "$srcdir/defs.in not found, check \$srcdir" 1>&2
exit 1
}
# User can set VERBOSE to see all output.
test -z "$VERBOSE" && exec >/dev/null 2>&1
echo "== Running test $0"
DOT='@DOT@'
# Turn on shell traces when VERBOSE=x.
if test "x$VERBOSE" = xx; then
set -x
else
:
fi

26
src/tgbatest/explicit.cc Normal file
View file

@ -0,0 +1,26 @@
#include <iostream>
#include "ltlenv/defaultenv.hh"
#include "tgba/tgbaexplicit.hh"
#include "tgbaalgos/dotty.hh"
int
main()
{
spot::ltl::default_environment& e =
spot::ltl::default_environment::instance();
spot::tgba_explicit a;
typedef spot::tgba_explicit::transition trans;
trans* t1 = a.create_transition("state 0", "state 1");
trans* t2 = a.create_transition("state 1", "state 2");
trans* t3 = a.create_transition("state 2", "state 0");
a.add_condition(t2, e.require("a"));
a.add_condition(t3, e.require("b"));
a.add_condition(t3, e.require("c"));
a.add_promise(t1, e.require("p"));
a.add_promise(t1, e.require("q"));
a.add_promise(t2, e.require("r"));
spot::dotty_reachable(std::cout, a);
}

25
src/tgbatest/explicit.test Executable file
View file

@ -0,0 +1,25 @@
#!/bin/sh
. ./defs
set -e
./explicit > stdout
cat >expected <<EOF
digraph G {
size="7.26,10.69"
0 [label="", style=invis]
1 [label="state 0"]
0 -> 1
2 [label="state 1"]
1 -> 2 [label="T\n<Prom[p]:1, Prom[q]:1>"]
3 [label="state 2"]
2 -> 3 [label="<a:1>\n<Prom[r]:1>"]
3 -> 1 [label="<b:1, c:1>\nT"]
}
EOF
diff stdout expected
rm stdout expected