Root/test/frame_ref

Source at commit 377b7f81193685f23c93546767a059e194419446 created 3 years 5 months ago.
By Werner Almesberger, fped.c: new option -m (for -p and -P) to suppress showing measurements
1#!/bin/sh
2. ./Common
3
4###############################################################################
5
6fped_dump "frame reference: \"frame\" (origin)" <<EOF
7frame f {}
8frame f @
9EOF
10expect <<EOF
11/* MACHINE-GENERATED ! */
12
13frame f {
14}
15
16package "_"
17unit mm
18
19frame f @
20EOF
21
22#------------------------------------------------------------------------------
23
24fped_dump "frame reference: \"%frame\" (current frame origin)" <<EOF
25frame f {}
26%frame f @
27EOF
28expect <<EOF
29/* MACHINE-GENERATED ! */
30
31frame f {
32}
33
34package "_"
35unit mm
36
37frame f @
38EOF
39
40#------------------------------------------------------------------------------
41
42fped_dump "frame reference: \"%frame\" (current frame vector)" <<EOF
43frame f {}
44v: vec @(0mm, 0mm)
45%frame f v
46EOF
47expect <<EOF
48/* MACHINE-GENERATED ! */
49
50frame f {
51}
52
53package "_"
54unit mm
55
56v: vec @(0mm, 0mm)
57frame f .
58EOF
59
60#------------------------------------------------------------------------------
61
62fped_dump "frame reference: \"%frame\" (other frame origin)" <<EOF
63frame f {}
64frame g {}
65%frame f g.@
66EOF
67expect <<EOF
68/* MACHINE-GENERATED ! */
69
70frame f {
71}
72
73frame g {
74    frame f @
75}
76
77package "_"
78unit mm
79
80EOF
81
82#------------------------------------------------------------------------------
83
84fped_dump "frame reference: \"%frame\" (other frame base)" <<EOF
85frame f {}
86frame g {
87    v: vec @(0mm, 0mm)
88}
89%frame f g.v
90EOF
91expect <<EOF
92/* MACHINE-GENERATED ! */
93
94frame f {
95}
96
97frame g {
98    v: vec @(0mm, 0mm)
99    frame f .
100}
101
102package "_"
103unit mm
104
105EOF
106
107#------------------------------------------------------------------------------
108
109fped_fail "frame reference: \"%frame\" (cycle)" <<EOF
110frame f {
111}
112
113frame g {
114    frame f @
115}
116
117%frame g f.@
118EOF
119expect <<EOF
1208: frame "g" is a parent of "f" near "@"
121EOF
122
123#------------------------------------------------------------------------------
124
125fped_dump "frame reference: \"%frame\" (out-of-order)" <<EOF
126frame f {
127}
128
129frame g {
130}
131
132%frame g f.@
133EOF
134expect <<EOF
135/* MACHINE-GENERATED ! */
136
137frame g {
138}
139
140frame f {
141    frame g @
142}
143
144package "_"
145unit mm
146
147EOF
148
149###############################################################################
150

Archive Download this file

Branches:
master



interactive