Root/test/meas_qual

Source at commit 103933acf59927d84df7f99d9580dfc0f45059c2 created 3 years 6 months ago.
By Werner Almesberger, fix a few whitespace issues in previous commit
1#!/bin/sh
2. ./Common
3
4###############################################################################
5
6fped_dump "qualified measurements: no qualifier" <<EOF
7frame c { v: vec @(0mm, 0mm) }
8frame b { frame c @ }
9frame a { frame b @ }
10frame a @
11meas c.v >> c.v
12EOF
13expect <<EOF
14/* MACHINE-GENERATED ! */
15
16frame c {
17    v: vec @(0mm, 0mm)
18}
19
20frame b {
21    frame c @
22}
23
24frame a {
25    frame b @
26}
27
28package "_"
29unit mm
30
31frame a @
32meas c.v >> c.v
33EOF
34
35#------------------------------------------------------------------------------
36
37fped_dump "qualified measurements: fully qualified" <<EOF
38frame c { v: vec @(0mm, 0mm) }
39frame b { frame c @ }
40frame a { frame b @ }
41frame a @
42meas a/b/c.v >> c.v
43EOF
44expect_grep '^meas' <<EOF
45meas a/b/c.v >> c.v
46EOF
47
48#------------------------------------------------------------------------------
49
50fped_dump "qualified measurements: partially qualified" <<EOF
51frame c { v: vec @(0mm, 0mm) }
52frame b { frame c @ }
53frame a { frame b @ }
54frame a @
55meas a/c.v >> c.v
56EOF
57expect_grep '^meas' <<EOF
58meas a/c.v >> c.v
59EOF
60
61#------------------------------------------------------------------------------
62
63fped_dump "qualified measurements: wrong order" <<EOF
64frame c { v: vec @(0mm, 0mm) }
65frame b { frame c @ }
66frame a { frame b @ }
67frame a @
68meas b/a/c.v >> c.v
69EOF
70expect_grep 'warning' <<EOF
715: warning: not all qualifiers can be reached near "v"
72EOF
73
74#------------------------------------------------------------------------------
75
76fped_dump "qualified measurements: unlinked frame" <<EOF
77frame c { v: vec @(0mm, 0mm) }
78frame b { frame c @ }
79frame a { frame b @ }
80frame x {}
81frame a @
82frame x @
83meas a/c.v >> x/c.v
84EOF
85expect_grep 'warning' <<EOF
867: warning: not all qualifiers can be reached near "v"
87EOF
88
89#------------------------------------------------------------------------------
90
91fped_fail "qualified measurements: duplicate qualifier" <<EOF
92frame c { v: vec @(0mm, 0mm) }
93frame b { frame c @ }
94frame a { frame b @ }
95frame a @
96meas b/b/c.v >> c.v
97EOF
98expect <<EOF
995: duplicate qualifier "b" near "v"
100EOF
101
102#------------------------------------------------------------------------------
103
104fped "qualified measurements: \"macro\" unqualified" <<EOF
105frame x {
106    a: vec @(0mm, 0mm)
107    b: vec .(d, 0mm)
108}
109frame a {
110    set d = 2mm
111    frame x @
112}
113frame b {
114    set d = 3mm
115    frame x @
116}
117frame a @
118vec @(1mm, 0mm)
119frame b .
120meas x.a >> x.b /* dummy */
121m: meas x.a >> x.b
122%meas m
123EOF
124expect <<EOF
1254
126EOF
127
128#------------------------------------------------------------------------------
129
130fped "qualified measurements: \"macro\" qualified (a)" <<EOF
131frame x {
132    a: vec @(0mm, 0mm)
133    b: vec .(d, 0mm)
134}
135frame a {
136    set d = 2mm
137    frame x @
138}
139frame b {
140    set d = 3mm
141    frame x @
142}
143frame a @
144vec @(1mm, 0mm)
145frame b .
146meas x.a >> x.b /* dummy */
147m: meas a/x.a >> a/x.b
148%meas m
149EOF
150expect <<EOF
1512
152EOF
153
154#------------------------------------------------------------------------------
155
156fped "qualified measurements: \"macro\" qualified (b)" <<EOF
157frame x {
158    a: vec @(0mm, 0mm)
159    b: vec .(d, 0mm)
160}
161frame a {
162    set d = 2mm
163    frame x @
164}
165frame b {
166    set d = 3mm
167    frame x @
168}
169frame a @
170vec @(1mm, 0mm)
171frame b .
172meas x.a >> x.b /* dummy */
173m: meas b/x.a >> b/x.b
174%meas m
175EOF
176expect <<EOF
1773
178EOF
179
180#------------------------------------------------------------------------------
181
182fped "qualified measurements: \"macro\" qualified (a/b)" <<EOF
183frame x {
184    a: vec @(0mm, 0mm)
185    b: vec .(d, 0mm)
186}
187frame a {
188    set d = 2mm
189    frame x @
190}
191frame b {
192    set d = 3mm
193    frame x @
194}
195frame a @
196vec @(1mm, 0mm)
197frame b .
198meas x.a >> x.b /* dummy */
199m: meas a/x.a >> b/x.b
200%meas m
201EOF
202expect <<EOF
2034
204EOF
205
206#------------------------------------------------------------------------------
207
208fped "qualified measurements: \"macro\" qualified (b/a)" <<EOF
209frame x {
210    a: vec @(0mm, 0mm)
211    b: vec .(d, 0mm)
212}
213frame a {
214    set d = 2mm
215    frame x @
216}
217frame b {
218    set d = 3mm
219    frame x @
220}
221frame a @
222vec @(1mm, 0mm)
223frame b .
224meas x.a >> x.b /* dummy */
225m: meas b/x.a >> a/x.b
226%meas m
227EOF
228expect <<EOF
2291
230EOF
231
232###############################################################################
233

Archive Download this file

Branches:
master



interactive