Imported Upstream version 4.6.0
[debian/atlc] / tests / 5b-check-s_and_-S_options_of_atlc-3conductor.test
1 #! /bin/sh
2
3 # Delete any files that may be left
4 rm -f $top_builddir/tmp/test-coupler2.E.even.bin $top_builddir/tmp/test-coupler2.E.even.bmp
5 rm -f $top_builddir/tmp/test-coupler2.E.odd.bin $top_builddir/tmp/test-coupler2.E.odd.bmp
6 rm -f $top_builddir/tmp/test-coupler2.Er.bin $top_builddir/tmp/test-coupler2.Er.bmp
7 rm -f $top_builddir/tmp/test-coupler2.Er.bmp $top_builddir/tmp/test-coupler2.Ex.even.bin
8 rm -f $top_builddir/tmp/test-coupler2.Ex.even.bmp $top_builddir/tmp/test-coupler2.Ex.odd.bin
9 rm -f $top_builddir/tmp/test-coupler2.Ex.odd.bmp $top_builddir/tmp/test-coupler2.Ey.even.bin
10 rm -f $top_builddir/tmp/test-coupler2.Ey.even.bmp $top_builddir/tmp/test-coupler2.Ey.odd.bin
11 rm -f $top_builddir/tmp/test-coupler2.Ey.odd.bmp $top_builddir/tmp/test-coupler2.U.even.bin
12 rm -f $top_builddir/tmp/test-coupler2.U.even.bmp $top_builddir/tmp/test-coupler2.U.odd.bin
13 rm -f $top_builddir/tmp/test-coupler2.U.odd.bmp $top_builddir/tmp/test-coupler2.V.even.bin
14 rm -f $top_builddir/tmp/test-coupler2.V.even.bmp $top_builddir/tmp/test-coupler2.V.odd.bin
15 rm -f $top_builddir/tmp/test-coupler2.V.odd.bmp $top_builddir/tmp/testcoupler2.V.odd.bmp.txt
16
17 cp  $top_srcdir/examples/test-coupler2.bmp $top_builddir/tmp
18
19 # Check that the -s and -S options are indeed doing
20 # what they are supposed to be doing. 
21
22
23 # Check the -S and -s options together allow no .bmp or .bin files
24 if [ "$mpirun_found" = "yes" ] ; then
25   mpirun -np 2 $top_builddir/src/non_gui/atlc -s -S $top_builddir/tmp/test-coupler2.bmp > $top_builddir/tmp/test-coupler2.bmp.txt
26 else
27   $top_builddir/src/non_gui/atlc -s -S $top_builddir/tmp/test-coupler2.bmp > $top_builddir/tmp/test-coupler2.bmp.txt
28 fi
29
30 if [ -f $top_builddir/tmp/test-coupler2.Ex.even.bmp ]  || [ -f $top_builddir/tmp/test-coupler2.Ey.odd.bin ] || [ -f $top_builddir/tmp/test-coupler2.Er.bin ] ; then
31   echo "FAILED-1:" $0 >> tests.log 
32   exit 1
33 fi  
34
35 # Delete any files created. There should be none.
36 rm -f $top_builddir/tmp/test-coupler2.E.even.bin
37 rm -f $top_builddir/tmp/test-coupler2.E.even.bmp
38 rm -f $top_builddir/tmp/test-coupler2.E.odd.bin
39 rm -f $top_builddir/tmp/test-coupler2.E.odd.bmp
40 rm -f $top_builddir/tmp/test-coupler2.Er.bin
41 rm -f $top_builddir/tmp/test-coupler2.Er.bmp
42 rm -f $top_builddir/tmp/test-coupler2.Ex.even.bin
43 rm -f $top_builddir/tmp/test-coupler2.Ex.even.bmp
44 rm -f $top_builddir/tmp/test-coupler2.Ex.odd.bin
45 rm -f $top_builddir/tmp/test-coupler2.Ex.odd.bmp
46 rm -f $top_builddir/tmp/test-coupler2.Ey.even.bin
47 rm -f $top_builddir/tmp/test-coupler2.Ey.even.bmp
48 rm -f $top_builddir/tmp/test-coupler2.Ey.odd.bin
49 rm -f $top_builddir/tmp/test-coupler2.Ey.odd.bmp
50 rm -f $top_builddir/tmp/test-coupler2.U.even.bin
51 rm -f $top_builddir/tmp/test-coupler2.U.even.bmp
52 rm -f $top_builddir/tmp/test-coupler2.U.odd.bin
53 rm -f $top_builddir/tmp/test-coupler2.U.odd.bmp
54 rm -f $top_builddir/tmp/test-coupler2.V.even.bin
55 rm -f $top_builddir/tmp/test-coupler2.V.even.bmp
56 rm -f $top_builddir/tmp/test-coupler2.V.odd.bin
57 rm -f $top_builddir/tmp/test-coupler2.V.odd.bmp
58
59 # Check that -S suppresses the creation of .bin, but not .bmp's
60 if [ "$mpirun_found" = "yes" ] ; then
61  mpirun -np 2 $top_builddir/src/non_gui/atlc -S $top_builddir/tmp/test-coupler2.bmp > $top_builddir/tmp/test-coupler2.bmp.txt
62 else
63   $top_builddir/src/non_gui/atlc -S $top_builddir/tmp/test-coupler2.bmp > $top_builddir/tmp/test-coupler2.bmp.txt
64 fi
65
66 if [ -f $top_builddir/tmp/test-coupler2.Ex.odd.bin ]  || [ -f $top_builddir/tmp/test-coupler2.Ey.odd.bin ] || [ ! -f $top_builddir/tmp/test-coupler2.Er.bmp ] ; then
67   echo "FAILED-2:" $0 >> tests.log 
68   exit 1
69 fi  
70
71 rm -f $top_builddir/tmp/test-coupler2.E.even.bin
72 rm -f $top_builddir/tmp/test-coupler2.E.even.bmp
73 rm -f $top_builddir/tmp/test-coupler2.E.odd.bin
74 rm -f $top_builddir/tmp/test-coupler2.E.odd.bmp
75 rm -f $top_builddir/tmp/test-coupler2.Er.bin
76 rm -f $top_builddir/tmp/test-coupler2.Er.bmp
77 rm -f $top_builddir/tmp/test-coupler2.Ex.even.bin
78 rm -f $top_builddir/tmp/test-coupler2.Ex.even.bmp
79 rm -f $top_builddir/tmp/test-coupler2.Ex.odd.bin
80 rm -f $top_builddir/tmp/test-coupler2.Ex.odd.bmp
81 rm -f $top_builddir/tmp/test-coupler2.Ey.even.bin
82 rm -f $top_builddir/tmp/test-coupler2.Ey.even.bmp
83 rm -f $top_builddir/tmp/test-coupler2.Ey.odd.bin
84 rm -f $top_builddir/tmp/test-coupler2.Ey.odd.bmp
85 rm -f $top_builddir/tmp/test-coupler2.U.even.bin
86 rm -f $top_builddir/tmp/test-coupler2.U.even.bmp
87 rm -f $top_builddir/tmp/test-coupler2.U.odd.bin
88 rm -f $top_builddir/tmp/test-coupler2.U.odd.bmp
89 rm -f $top_builddir/tmp/test-coupler2.V.even.bin
90 rm -f $top_builddir/tmp/test-coupler2.V.even.bmp
91 rm -f $top_builddir/tmp/test-coupler2.V.odd.bin
92 rm -f $top_builddir/tmp/test-coupler2.V.odd.bmp
93
94 # Check that -s suppresses the creation of .bmp's, but not .bin's
95 if [ "$mpirun_found" = "yes" ] ; then
96    mpirun -np 2 $top_builddir/src/non_gui/atlc -s $top_builddir/tmp/test-coupler2.bmp > $top_builddir/tmp/test-coupler2.bmp.txt
97 else
98    $top_builddir/src/non_gui/atlc -s $top_builddir/tmp/test-coupler2.bmp > $top_builddir/tmp/test-coupler2.bmp.txt
99 fi
100
101 if [ -f $top_builddir/tmp/test-coupler2.Ex.even.bmp ]  || [ -f $top_builddir/tmp/test-coupler2.Ey.odd.bmp ] || [ ! -f $top_builddir/tmp/test-coupler2.Er.bin ]  ; then
102   echo "FAILED-3:" $0 >> tests.log 
103   exit 1
104 fi
105
106 # Check that no options creates both the .bmp's and .bin's
107 if [ "$mpirun_found" = "yes" ] ; then
108   mpirun -np 2 $top_builddir/src/non_gui/atlc  $top_builddir/tmp/test-coupler2.bmp > /dev/null
109 else
110   $top_builddir/src/non_gui/atlc  $top_builddir/tmp/test-coupler2.bmp > /dev/null
111 fi
112
113 if [ ! -f $top_builddir/tmp/test-coupler2.Ex.odd.bmp ]  || [ ! -f $top_builddir/tmp/test-coupler2.Ey.odd.bmp ] || [ ! -f $top_builddir/tmp/test-coupler2.Er.bin ]  ; then
114   echo "FAILED-2:" $0 >> tests.log 
115   exit 1
116 fi
117 echo "PASSED:" $0 >> tests.log 
118 rm -f $top_builddir/tmp/test-coupler2.bmp $top_builddir/tmp/test-coupler2.bmp.txt
119 rm -f $top_builddir/tmp/test-coupler2.Ex.odd.bmp $top_builddir/tmp/test-coupler2.Ey.odd.bmp
120 rm -f $top_builddir/tmp/test-coupler2.E.odd.bmp $top_builddir/tmp/test-coupler2.U.odd.bmp
121 rm -f $top_builddir/tmp/test-coupler2.V.odd.bmp 
122 rm -f $top_builddir/tmp/test-coupler2.bmp $top_builddir/tmp/test-coupler2.bmp.txt
123 rm -f $top_builddir/tmp/test-coupler2.Ex.even.bmp $top_builddir/tmp/test-coupler2.Ey.even.bmp
124 rm -f $top_builddir/tmp/test-coupler2.E.even.bmp $top_builddir/tmp/test-coupler2.U.even.bmp
125 rm -f $top_builddir/tmp/test-coupler2.V.even.bmp $top_builddir/tmp/test-coupler2.V.even.bin  
126 rm -f $top_builddir/tmp/test-coupler2.bin $top_builddir/tmp/test-coupler2.bin.txt
127 rm -f $top_builddir/tmp/test-coupler2.Ex.odd.bin $top_builddir/tmp/test-coupler2.Ey.odd.bin
128 rm -f $top_builddir/tmp/test-coupler2.E.odd.bin $top_builddir/tmp/test-coupler2.U.odd.bin
129 rm -f $top_builddir/tmp/test-coupler2.V.odd.bin $top_builddir/tmp/test-coupler2.V.even.bin  
130 rm -f $top_builddir/tmp/test-coupler2.Ex.even.bin $top_builddir/tmp/test-coupler2.Ey.even.bin
131 rm -f $top_builddir/tmp/test-coupler2.E.even.bin $top_builddir/tmp/test-coupler2.U.even.bin
132 rm -f $top_builddir/tmp/test-coupler2.Er.bmp $top_builddir/tmp/test-coupler2.Er.bin
133 exit 0