Fix use of "export" to work with traditional shells.
[pspp-builds.git] / tests / bugs / double-frequency.sh
1 #!/bin/sh
2
3 # This program tests for a bug where pspp would crash if two frequencies
4 # Commands existed in a input file
5
6 TEMPDIR=/tmp/pspp-tst-$$
7 TESTFILE=$TEMPDIR/`basename $0`.sps
8
9 here=`pwd`;
10
11 # ensure that top_srcdir is absolute
12 cd $top_srcdir; top_srcdir=`pwd`
13
14
15 STAT_CONFIG_PATH=$top_srcdir/config
16 export STAT_CONFIG_PATH
17
18
19 cleanup()
20 {
21      rm -rf $TEMPDIR
22 }
23
24
25 fail()
26 {
27     echo $activity
28     echo FAILED
29     cleanup;
30     exit 1;
31 }
32
33
34 no_result()
35 {
36     echo $activity
37     echo NO RESULT;
38     cleanup;
39     exit 2;
40 }
41
42 pass()
43 {
44     cleanup;
45     exit 0;
46 }
47
48 mkdir -p $TEMPDIR
49
50
51 activity="create data"
52 cat << EOF > $TEMPDIR/ff.stat 
53
54 data list free /v1 v2.
55 begin data.
56 0 1
57 2 3 
58 4 5
59 3 4
60 end data.
61
62 frequencies v1 v2.
63 frequencies v1 v2.
64 EOF
65 if [ $? -ne 0 ] ; then no_result ; fi
66
67
68 cd $TEMPDIR
69
70 activity="run data"
71 $SUPERVISOR $here/../src/pspp  $TEMPDIR/ff.stat
72 if [ $? -ne 0 ] ; then fail ; fi
73
74
75 pass;