Added linked-list.[ch] --- a general purpose linked list module.
[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 export STAT_CONFIG_PATH=$top_srcdir/config
16
17
18 cleanup()
19 {
20      rm -rf $TEMPDIR
21 }
22
23
24 fail()
25 {
26     echo $activity
27     echo FAILED
28     cleanup;
29     exit 1;
30 }
31
32
33 no_result()
34 {
35     echo $activity
36     echo NO RESULT;
37     cleanup;
38     exit 2;
39 }
40
41 pass()
42 {
43     cleanup;
44     exit 0;
45 }
46
47 mkdir -p $TEMPDIR
48
49
50 activity="create data"
51 cat << EOF > $TEMPDIR/ff.stat 
52
53 data list free /v1 v2.
54 begin data.
55 0 1
56 2 3 
57 4 5
58 3 4
59 end data.
60
61 frequencies v1 v2.
62 frequencies v1 v2.
63 EOF
64 if [ $? -ne 0 ] ; then no_result ; fi
65
66
67 cd $TEMPDIR
68
69 activity="run data"
70 $SUPERVISOR $here/../src/pspp  $TEMPDIR/ff.stat
71 if [ $? -ne 0 ] ; then fail ; fi
72
73
74 pass;