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:
78
b2/test/subprint
Executable file
78
b2/test/subprint
Executable 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
|
||||
|
||||
###############################################################################
|
||||
Reference in New Issue
Block a user