1
0
mirror of git://projects.qi-hardware.com/fped.git synced 2024-09-30 11:33:14 +03:00
fped/test/meas_qual
werner 02518334f2 Updated regression tests for output change in r5974 and improved handling of
cores.

- test/structure, test/del_vec, test/frame_ref, test/meas_qual, test/del_frame:
  added newline after "unit" directive (reported by Xiangfu Liu)
- test/Common: new function expect_sed for post-processing of test output
- test/tsort: use expect_sed to ignore "(core dumped") after "Aborted"
- test/Common: if there is a file called "core", don't run it
- Makefile (clean): remove test/core



git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5978 99fdad57-331a-0410-800a-d7fa5415bdb3
2010-10-12 15:32:15 +00:00

233 lines
3.9 KiB
Bash
Executable File

#!/bin/sh
. ./Common
###############################################################################
fped_dump "qualified measurements: no qualifier" <<EOF
frame c { v: vec @(0mm, 0mm) }
frame b { frame c @ }
frame a { frame b @ }
frame a @
meas c.v >> c.v
EOF
expect <<EOF
/* MACHINE-GENERATED ! */
frame c {
v: vec @(0mm, 0mm)
}
frame b {
frame c @
}
frame a {
frame b @
}
package "_"
unit mm
frame a @
meas c.v >> c.v
EOF
#------------------------------------------------------------------------------
fped_dump "qualified measurements: fully qualified" <<EOF
frame c { v: vec @(0mm, 0mm) }
frame b { frame c @ }
frame a { frame b @ }
frame a @
meas a/b/c.v >> c.v
EOF
expect_grep '^meas' <<EOF
meas a/b/c.v >> c.v
EOF
#------------------------------------------------------------------------------
fped_dump "qualified measurements: partially qualified" <<EOF
frame c { v: vec @(0mm, 0mm) }
frame b { frame c @ }
frame a { frame b @ }
frame a @
meas a/c.v >> c.v
EOF
expect_grep '^meas' <<EOF
meas a/c.v >> c.v
EOF
#------------------------------------------------------------------------------
fped_dump "qualified measurements: wrong order" <<EOF
frame c { v: vec @(0mm, 0mm) }
frame b { frame c @ }
frame a { frame b @ }
frame a @
meas b/a/c.v >> c.v
EOF
expect_grep 'warning' <<EOF
5: warning: not all qualifiers can be reached near "v"
EOF
#------------------------------------------------------------------------------
fped_dump "qualified measurements: unlinked frame" <<EOF
frame c { v: vec @(0mm, 0mm) }
frame b { frame c @ }
frame a { frame b @ }
frame x {}
frame a @
frame x @
meas a/c.v >> x/c.v
EOF
expect_grep 'warning' <<EOF
7: warning: not all qualifiers can be reached near "v"
EOF
#------------------------------------------------------------------------------
fped_fail "qualified measurements: duplicate qualifier" <<EOF
frame c { v: vec @(0mm, 0mm) }
frame b { frame c @ }
frame a { frame b @ }
frame a @
meas b/b/c.v >> c.v
EOF
expect <<EOF
5: duplicate qualifier "b" near "v"
EOF
#------------------------------------------------------------------------------
fped "qualified measurements: \"macro\" unqualified" <<EOF
frame x {
a: vec @(0mm, 0mm)
b: vec .(d, 0mm)
}
frame a {
set d = 2mm
frame x @
}
frame b {
set d = 3mm
frame x @
}
frame a @
vec @(1mm, 0mm)
frame b .
meas x.a >> x.b /* dummy */
m: meas x.a >> x.b
%meas m
EOF
expect <<EOF
4
EOF
#------------------------------------------------------------------------------
fped "qualified measurements: \"macro\" qualified (a)" <<EOF
frame x {
a: vec @(0mm, 0mm)
b: vec .(d, 0mm)
}
frame a {
set d = 2mm
frame x @
}
frame b {
set d = 3mm
frame x @
}
frame a @
vec @(1mm, 0mm)
frame b .
meas x.a >> x.b /* dummy */
m: meas a/x.a >> a/x.b
%meas m
EOF
expect <<EOF
2
EOF
#------------------------------------------------------------------------------
fped "qualified measurements: \"macro\" qualified (b)" <<EOF
frame x {
a: vec @(0mm, 0mm)
b: vec .(d, 0mm)
}
frame a {
set d = 2mm
frame x @
}
frame b {
set d = 3mm
frame x @
}
frame a @
vec @(1mm, 0mm)
frame b .
meas x.a >> x.b /* dummy */
m: meas b/x.a >> b/x.b
%meas m
EOF
expect <<EOF
3
EOF
#------------------------------------------------------------------------------
fped "qualified measurements: \"macro\" qualified (a/b)" <<EOF
frame x {
a: vec @(0mm, 0mm)
b: vec .(d, 0mm)
}
frame a {
set d = 2mm
frame x @
}
frame b {
set d = 3mm
frame x @
}
frame a @
vec @(1mm, 0mm)
frame b .
meas x.a >> x.b /* dummy */
m: meas a/x.a >> b/x.b
%meas m
EOF
expect <<EOF
4
EOF
#------------------------------------------------------------------------------
fped "qualified measurements: \"macro\" qualified (b/a)" <<EOF
frame x {
a: vec @(0mm, 0mm)
b: vec .(d, 0mm)
}
frame a {
set d = 2mm
frame x @
}
frame b {
set d = 3mm
frame x @
}
frame a @
vec @(1mm, 0mm)
frame b .
meas x.a >> x.b /* dummy */
m: meas b/x.a >> a/x.b
%meas m
EOF
expect <<EOF
1
EOF
###############################################################################