1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2025-04-21 12:27:27 +03:00

b2/: add "print VAR" command in substitutions (for debugging/tracing)

This commit is contained in:
Werner Almesberger
2012-06-03 13:15:31 -03:00
parent 3f4a06843a
commit ee0a2a41fa
5 changed files with 132 additions and 2 deletions

78
b2/test/subprint Executable file
View File

@@ -0,0 +1,78 @@
#!/bin/bash
. ./Common
###############################################################################
tst "substitutions: print input variable" -ds -q foo=bar <<EOF
!-s
print foo
EOF
expect <<EOF
print foo
foo(in) = "bar"
EOF
#------------------------------------------------------------------------------
tst "substitutions: print output variable" -q <<EOF
!-s
foo = x
print foo
EOF
expect <<EOF
foo(out) = "x"
foo=x
EOF
#------------------------------------------------------------------------------
tst "substitutions: print output variable overriding input" -q x=y <<EOF
!-s
x = z
print x
EOF
expect <<EOF
x(out) = "z"
x=z
EOF
#------------------------------------------------------------------------------
tst "substitutions: print unknown variable" -q <<EOF
!-s
print x
EOF
expect <<EOF
x = ?
EOF
#------------------------------------------------------------------------------
tst "substitutions: print conditionally defined variable" -q x=y <<EOF
!-s
x=y { z=1 }
print z
EOF
expect <<EOF
z(out) = "1"
z=1
EOF
#------------------------------------------------------------------------------
tst "substitutions: print conditionally undefined variable" -q x=z <<EOF
!-s
x=y { z=1 }
print z
EOF
expect <<EOF
z = ?
EOF
###############################################################################