Imported Upstream version 4.6.0
[debian/atlc] / tests / 5a-check-s_and_-S_options_of_atlc-2conductor.test
1 #! /bin/sh
2 # Check that the -s and -S options are indeed doing
3 # what they are supposed to be doing. 
4 # going to execute a pwd as soon as entering the test. 
5
6 # Delete any files that may be left by mistake
7
8 # There should now be no coax2* files, except $top_srcdir/examples/coax2.bmp
9 rm -f $top_builddir/tmp/coax2.*
10 cp $top_srcdir/examples/coax2.bmp $top_builddir/tmp
11
12 # Check the -S and -s options together prevent all ( .bmp or .bin files ) being created. 
13 if [ "$mpirun_found" = "yes" ] ; then
14   mpirun -np 2 $top_builddir/src/non_gui/atlc -s -S $top_builddir/tmp/coax2.bmp > /dev/null
15 else
16   $top_builddir/src/non_gui/atlc -s -S $top_builddir/tmp/coax2.bmp > /dev/null
17 fi
18
19 if [ -f $top_builddir/tmp/coax2.Ex.bmp ]  || [ -f $top_builddir/tmp/coax2.Ey.bin ] || [ -f top_builddir/tmp/coax2.Er.bin ] ; then
20   echo "FAILED:" $0 >> tests.log 
21   exit 1
22 fi  
23
24 # Delete any files created. There should be none.
25
26
27 # Check that -S suppresses the creation of .bin, but not .bmp's
28 if [ "$mpirun_found" = "yes" ] ; then
29   npirun -np 2$top_builddir/src/non_gui/atlc -S $top_builddir/tmp/coax2.bmp > /dev/null
30 else
31   $top_builddir/src/non_gui/atlc -S $top_builddir/tmp/coax2.bmp > /dev/null
32 fi
33
34 if [ -f $top_builddir/tmp/coax2.Ex.bin ]  || [ -f $top_builddir/tmp/coax2.Ey.bin ] || [ -f $top_builddir/tmp/coax2.Er.bin ] || [ ! -f  $top_builddir/tmp/coax2.Er.bmp ] ; then
35   echo "FAILED:" $0 >> tests.log 
36   exit 1
37 fi
38
39 rm  -f $top_builddir/tmp/coax2.Ex.bmp
40 rm  -f $top_builddir/tmp/coax2.Ey.bmp
41 rm  -f $top_builddir/tmp/coax2.E.bmp
42 rm  -f $top_builddir/tmp/coax2.U.bmp
43 rm  -f $top_builddir/tmp/coax2.V.bmp
44 rm  -f $top_builddir/tmp/coax2.Er.bmp
45
46 rm  -f $top_builddir/tmp/coax2.Ex.bin
47 rm  -f $top_builddir/tmp/coax2.Ey.bin
48 rm  -f $top_builddir/tmp/coax2.E.bin
49 rm  -f $top_builddir/tmp/coax2.U.bin
50 rm  -f $top_builddir/tmp/coax2.V.bin
51 rm  -f $top_builddir/tmp/coax2.Er.bin
52
53 # Check that no options creates.bmp's and  bin's
54
55 # Check that -s suppresses the creation of .bmp's, but not .bin's
56 if [ "$mpirun_found" = "yes" ] ; then
57   mpirun -np 2 $top_builddir/src/non_gui/atlc -s $top_builddir/tmp/coax2.bmp > /dev/null
58 else
59   $top_builddir/src/non_gui/atlc -s $top_builddir/tmp/coax2.bmp > /dev/null
60 fi
61
62 if [ -f $top_builddir/tmp/coax2.Ex.bmp ]  || [ -f $top_builddir/tmp/coax2.Ey.bmp ] || [ ! -f $top_builddir/tmp/coax2.Er.bin ]  ; then
63   echo "FAILED:" $0 >> tests.log 
64   exit 1
65 fi
66
67 rm  -f $top_builddir/tmp/coax2.Ex.bmp
68 rm  -f $top_builddir/tmp/coax2.Ey.bmp
69 rm  -f $top_builddir/tmp/coax2.E.bmp
70 rm  -f $top_builddir/tmp/coax2.U.bmp
71 rm  -f $top_builddir/tmp/coax2.V.bmp
72 rm  -f $top_builddir/tmp/coax2.Er.bmp
73
74 rm  -f $top_builddir/tmp/coax2.Ex.bin
75 rm  -f $top_builddir/tmp/coax2.Ey.bin
76 rm  -f $top_builddir/tmp/coax2.E.bin
77 rm  -f $top_builddir/tmp/coax2.U.bin
78 rm  -f $top_builddir/tmp/coax2.V.bin
79 rm  -f $top_builddir/tmp/coax2.Er.bin
80
81 # Check that no options creates.bmp's and  bin's
82 if [ "$mpirun_found" = "yes" ] ; then
83   $top_builddir/src/non_gui/atlc $top_builddir/tmp/coax2.bmp > /dev/null
84 else
85   $top_builddir/src/non_gui/atlc $top_builddir/tmp/coax2.bmp > /dev/null
86 fi
87
88 if [ ! -f $top_builddir/tmp/coax2.Ex.bmp ]  || [ ! -f $top_builddir/tmp/coax2.Ey.bmp ] || [ ! -f $top_builddir/tmp/coax2.Er.bin ]  ; then
89   echo "FAILED:" $0 >> tests.log 
90   exit 1
91 fi
92   rm   $top_builddir/tmp/coax2.Ex.bin $top_builddir/tmp/coax2.Ey.bin
93   rm   $top_builddir/tmp/coax2.E.bin $top_builddir/tmp/coax2.U.bin
94   rm   $top_builddir/tmp/coax2.V.bin $top_builddir/tmp/coax2.Er.bin
95   rm   $top_builddir/tmp/coax2.Ex.bmp $top_builddir/tmp/coax2.Ey.bmp
96   rm   $top_builddir/tmp/coax2.E.bmp $top_builddir/tmp/coax2.U.bmp
97   rm   $top_builddir/tmp/coax2.V.bmp $top_builddir/tmp/coax2.Er.bmp
98   rm -f  $top_builddir/tmp/coax2.bmp
99   echo "PASSED:" $0 >> tests.log 
100 exit 0