1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-12-23 03:01:46 +02:00
fped/test/structure
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

104 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
. ./Common
###############################################################################
fped_dump "structure: empty file" <<EOF
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "_"
unit mm
EOF
#------------------------------------------------------------------------------
fped_dump "structure: just an empty frame definition" <<EOF
frame foo {
}
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
frame foo {
}
package "_"
unit mm
EOF
#------------------------------------------------------------------------------
fped_dump "structure: just the package name" <<EOF
package "hello"
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "hello"
unit mm
EOF
#------------------------------------------------------------------------------
fped_dump "structure: just the unit" <<EOF
unit mil
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "_"
unit mil
EOF
#------------------------------------------------------------------------------
fped_dump "structure: just one root frame item" <<EOF
vec @(1mm, 1mm)
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
package "_"
unit mm
__0: vec @(1mm, 1mm)
EOF
#------------------------------------------------------------------------------
fped_dump "structure: frame plus measurement" <<EOF
frame f {
a: vec @(0mm, 0mm)
b: vec @(1mm, 1mm)
}
meas f.a -> f.b
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
frame f {
a: vec @(0mm, 0mm)
b: vec @(1mm, 1mm)
}
package "_"
unit mm
meas f.a -> f.b
EOF
#------------------------------------------------------------------------------
fped_fail "structure: measurement in frame" <<EOF
frame f {
a: vec @(0mm, 0mm)
b: vec @(1mm, 1mm)
meas f.a -> f.b
}
EOF
expect <<EOF
4: syntax error near "meas"
EOF
###############################################################################