1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-11-22 13:39:21 +02:00
fped/test/tsort
werner 39fef16d1c Got rid of the requirement to have a "package" directive. Fixed a grammar error
found in the process. Also taught the regression test system a new trick: the
path to "fped" can be passed in the environment variable FPED. E.g.,
FPED=fped.r5943 make test

- fped.c (usage, main): duplicating the -T option produces a dump to stdout
  before exiting (like %dump would)
- test/Common: new command fped_dump to invoked fped with a second -T option
- test/Common: if the environment variable FPED is set, use its content to
  invoke fped (default is ../fped)
- test/Common: if the environment variable CWD_PREFIX is set, prepend it to
  $FPED if the latter is a relative path 
- Makefile (test, tests): set CWD_PREFIX to .., so that the path given in FPED
  is valid at the point of invocation
- fpd.y: revised grammar to make "package" optional
- fpd.y: measurements were syntactically allowed inside non-root frame
  (test/structure)
- test/structure: test various combinations of the grammatical file structure
- test/tsort: removed all the now unnecessary "package" directives



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5944 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-04-26 23:11:22 +00:00

140 lines
1.9 KiB
Bash

#!/bin/sh
. ./Common
###############################################################################
fped "tsort: total order" <<EOF
%tsort {
a b
a c
a d
b c
b d
c d
}
EOF
expect <<EOF
a
b
c
d
EOF
#------------------------------------------------------------------------------
fped "tsort: partial order change (1)" <<EOF
%tsort {
a b
a c
a d
d b
}
EOF
expect <<EOF
a
c
d
b
EOF
#------------------------------------------------------------------------------
fped "tsort: partial order change (2)" <<EOF
%tsort {
b c
c d
a b
}
EOF
expect <<EOF
a
b
c
d
EOF
#------------------------------------------------------------------------------
fped "tsort: old order differs from resolution order" <<EOF
%tsort {
+a +b +c +d
a c
a b
a d
}
EOF
expect <<EOF
a
b
c
d
EOF
#------------------------------------------------------------------------------
fped "tsort: order change due to priority" <<EOF
%tsort {
a b
a c 1
a d
}
EOF
expect <<EOF
a
c
b
d
EOF
#------------------------------------------------------------------------------
fped "tsort: priority accumulation without decay" <<EOF
%tsort {
+a +b +c +d
a b 1
a d 1
}
EOF
expect <<EOF
a
b
d
c
EOF
#------------------------------------------------------------------------------
fped "tsort: priority accumulation with decay" <<EOF
%tsort {
+a -b +c +d
a b 1
a d 1
}
EOF
expect <<EOF
a
b
c
d
EOF
#------------------------------------------------------------------------------
fped_fail "tsort: cycle" <<EOF
%tsort {
a b
b a
}
EOF
expect <<EOF
cycle detected in partial order
Aborted (core dumped)
EOF
# not entirely comfortable about the "Aborted (core dumped)". It's a system
# message (from the shell) that may get mangled. Also, since few people keep
# their cores these days, "(core dumped)" shouldn't really appear. Wonder why
# it does. strace agrees that __WCOREFLAG is set ...
###############################################################################