Imported Upstream version 4.6.0
[debian/atlc] / tests / 3b-create_bmp_for_rect_cen_in_rect.txt.test
1 #! /bin/sh
2 # Check that the inductance per metre calculated from
3 # tests.bmp is the correct value.
4 # .bin files are unchecked, so let removed them.
5 rm -f test.*.bin
6
7 if [ -n "$mpirun_found" ] ; then
8   mpirun -np 2 $top_builddir/src/non_gui/atlc -s -S $top_builddir/tmp/test.bmp > $top_builddir/tmp/test.txt 2> /dev/null
9 else
10   $top_builddir/src/non_gui/atlc -s -S $top_builddir/tmp/test.bmp > $top_builddir/tmp/test.txt
11 fi
12
13 # Check the inductance per metre, which should be in column 12 and 
14 # should be 340.8 nH/m
15
16 Lo=`cat $top_builddir/tmp/test.txt | awk '{print $12}'`
17 Zo=`cat $top_builddir/tmp/test.txt | awk '{print $6}'`
18
19 if [ -z "$Lo" ] || [ -z "$Zo" ] ; then
20   exit 1
21 fi
22
23 if [ $Lo = 341.9 ] && [ $Zo = 102.506 ] ; then
24   rm $top_builddir/tmp/test.txt
25   rm $top_builddir/tmp/test.bmp
26   echo "PASSED:" $0 >> tests.log
27   exit 0
28 else
29   echo "FAILED:" $0 >> tests.log
30   exit 1
31 fi