1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 19:33:20 +02:00
eda-tools/b2/test/char
2012-06-02 05:55:28 -03:00

109 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
. ./Common
###############################################################################
tst "characteristics: one file" -dc <<EOF
<T> = R;
<FP> = 0402<0603<0805;
{ FP=<FP> }
T=<T> {
R: { R=#R TOL=%R };
};
!-c
FOO BAR1 T=R FP=0603 R=100R TOL=5%
FOO BAR2 T=R FP=0603 R=1k TOL=1%
EOF
expect <<EOF
FOO BAR1
FP=0603 T=R R=100R TOL=-5/+5%
FOO BAR2
FP=0603 T=R R=1000R TOL=-1/+1%
EOF
#------------------------------------------------------------------------------
tst "characteristics: two files" -dc <<EOF
<T> = R;
<FP> = 0402<0603<0805;
{ FP=<FP> }
T=<T> {
R: { R=#R TOL=%R };
};
!-c1
FOO BAR1 T=R FP=0603 R=100R TOL=5%
FOO BAR2 T=R FP=0603 R=1k TOL=1%
!-c2
FOO BAR3 T=R FP=0402 R=100R TOL=2%
EOF
expect <<EOF
FOO BAR1
FP=0603 T=R R=100R TOL=-5/+5%
FOO BAR2
FP=0603 T=R R=1000R TOL=-1/+1%
FOO BAR3
FP=0402 T=R R=100R TOL=-2/+2%
EOF
#------------------------------------------------------------------------------
tst_fail "characteristics: duplicate part" -dc <<EOF
<T> = R;
<FP> = 0402<0603<0805;
{ FP=<FP> }
T=<T> {
R: { R=#R TOL=%R };
};
!-c
FOO BAR1 T=R FP=0603 R=100R TOL=5%
FOO BAR1 T=R FP=0603 R=1k TOL=1%
EOF
expect <<EOF
c:3: FOO BAR1 parameters already defined
EOF
#------------------------------------------------------------------------------
tst_fail "characteristics: invalid/unknown value" -dc <<EOF
<T> = R;
<FP> = 0402<0603<0805;
{ FP=<FP> }
T=<T> {
R: { R=#R TOL=%R };
};
!-c
FOO BAR1 T=R FP=0603 R=100R TOL=5%
FOO BAR2 T=R FP=0603 R=1uF
EOF
expect <<EOF
c:3: invalid value for R
EOF
#------------------------------------------------------------------------------
tst "characteristics: unknown parameter" -dc <<EOF
<T> = R;
<FP> = 0402<0603<0805;
{ FP=<FP> }
T=<T> {
R: { R=#R TOL=%R };
};
!-c
FOO BAR1 T=R FP=0603 R=100R TOL=5%
FOO BAR2 T=R FP=0603 R=1k TOL=1% BLAH=3
EOF
expect <<EOF
c:3: warning: extra parameter: BLAH
FOO BAR1
FP=0603 T=R R=100R TOL=-5/+5%
FOO BAR2
FP=0603 T=R R=1000R TOL=-1/+1%
EOF
###############################################################################