8e21dfd2957db306ebfe1c4a4112efa2d01cc677
[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
8 cleanup()
9 {
10      rm -rf $TEMPDIR
11 }
12
13
14 fail()
15 {
16     echo $activity
17     echo FAILED
18     cleanup;
19     exit 1;
20 }
21
22
23 no_result()
24 {
25     echo $activity
26     echo NO RESULT;
27     cleanup;
28     exit 2;
29 }
30
31 pass()
32 {
33     cleanup;
34     exit 0;
35 }
36
37 mkdir -p $TEMPDIR
38
39 here=`pwd`;
40
41 activity="create data"
42 cat << EOF > $TEMPDIR/ff.stat 
43
44 data list free /v1 v2.
45 begin data.
46 0 1
47 2 3 
48 4 5
49 3 4
50 end data.
51
52 frequencies v1 v2.
53 frequencies v1 v2.
54 EOF
55 if [ $? -ne 0 ] ; then no_result ; fi
56
57 cd $TEMPDIR
58
59 activity="run data"
60 $here/../src/pspp $TEMPDIR/ff.stat
61 if [ $? -ne 0 ] ; then fail ; fi
62
63
64 pass;