Imported Upstream version 4.6.0
[debian/atlc] / tests / 6a-create_and_check_25ohm_201Pixel_high_symmetrical_stripline.test
1 #!/bin/sh
2 # A bitmap is created of a symmetrical_stripline. By adding the -v option
3 # to create_bmp_for_symmetrical_stripline the theoretical impedance
4 # is computed. 
5 # atlc is then called, and its estimate calculated, which will differ 
6 # slightly from the theoretical data 
7
8 # Create a bitmap and compute its theeoretical impedance. 
9 ZoTheory=`$top_builddir/src/non_gui/create_bmp_for_symmetrical_stripline -v 1512 201 668 $top_builddir/tmp/25ohm-201h.bmp | awk '{print $4}'`
10
11 # Generate a checksum for the file created
12 MD5SUM=`$top_builddir/tools/src/mymd5sum $top_builddir/tmp/25ohm-201h.bmp`
13
14 # Now run atlc on this bitmap and check it close to that computed. 
15 if [ "x$mpirun" = "xyes" ] ; then
16   Zoatlc=`mpirun -np 2 $top_builddir/src/non_gui/atlc -S $top_builddir/tmp/25ohm-201h.bmp | awk '{print $6}'`
17 else
18   Zoatlc=`$top_builddir/src/non_gui/atlc -S $top_builddir/tmp/25ohm-201h.bmp | awk '{print $6}'`
19 fi  
20
21 # Generate a checksum for a file created by atlc. 
22 EXMD5SUM=`$top_builddir/tools/src/mymd5sum $top_builddir/tmp/25ohm-201h.Ex.bmp`
23
24 if [ -z "$Zoatlc" ]  || [ -z "$ZoTheory" ] || [ -z "$MD5SUM" ] || [ -z "$EXMD5SUM" ] ; then  
25   exit 1
26 fi
27
28 # "Zo theory = " $ZoTheory "Zo altc= " $Zoatlc " cksum of bitmap" $MD5SUM "cksum of .Ex.bmp= " $EXMD5SUM
29
30
31 if [ $ZoTheory = 25.017590  ] && [ $Zoatlc = 24.932 ] && [ $MD5SUM = 44e86f6bcec1a61db9564040ec93557c ] && [ $EXMD5SUM = 499efd42aa2610c23f6995071e060e69 ] ; then
32 # Remvove the unwanted files. 
33   rm $top_builddir/tmp/25ohm-201h.Ex.bmp
34   rm $top_builddir/tmp/25ohm-201h.bmp
35   rm $top_builddir/tmp/25ohm-201h.Ey.bmp
36   rm $top_builddir/tmp/25ohm-201h.E.bmp
37   rm $top_builddir/tmp/25ohm-201h.V.bmp
38   rm $top_builddir/tmp/25ohm-201h.U.bmp
39   rm $top_builddir/tmp/25ohm-201h.Er.bmp
40
41   echo "PASSED:" $0 >> tests.log
42   exit 0
43 else
44   echo "FAILED:" $0 >> tests.log
45   exit 1
46 fi
47
48