Fix use of "export" to work with traditional shells.
[pspp-builds.git] / tests / bugs / recode-copy-bug.sh
1 #!/bin/sh
2
3 # This program tests ....
4
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
7
8 here=`pwd`;
9
10 # ensure that top_srcdir is absolute
11 cd $top_srcdir; top_srcdir=`pwd`
12
13 STAT_CONFIG_PATH=$top_srcdir/config
14 export STAT_CONFIG_PATH
15
16
17 cleanup()
18 {
19      rm -rf $TEMPDIR
20 }
21
22
23 fail()
24 {
25     echo $activity
26     echo FAILED
27     cleanup;
28     exit 1;
29 }
30
31
32 no_result()
33 {
34     echo $activity
35     echo NO RESULT;
36     cleanup;
37     exit 2;
38 }
39
40 pass()
41 {
42     cleanup;
43     exit 0;
44 }
45
46 mkdir -p $TEMPDIR
47
48 activity="copy template 1" 
49 cp $top_srcdir/tests/bugs/recode-copy-bug-1.stat $TEMPDIR
50 if [ $? -ne 0 ] ; then no_result ; fi
51
52 activity="copy template 2" 
53 cp $top_srcdir/tests/bugs/recode-copy-bug-2.stat $TEMPDIR
54 if [ $? -ne 0 ] ; then no_result ; fi
55
56 activity="chdir"
57 cd $TEMPDIR
58 if [ $? -ne 0 ] ; then no_result ; fi
59
60
61 activity="run program"
62 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/recode-copy-bug-1.stat
63 if [ $? -ne 0 ] ; then no_result ; fi
64
65
66 activity="compare output"
67 diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-1.out
68 if [ $? -ne 0 ] ; then fail ; fi
69
70
71 activity="run program"
72 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/recode-copy-bug-2.stat
73 if [ $? -ne 0 ] ; then no_result ; fi
74
75
76 activity="compare output"
77 diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-2.out
78 if [ $? -ne 0 ] ; then fail ; fi
79
80 pass;