559c5198014e9457e563e63c70d4645d409a8105
[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 export STAT_CONFIG_PATH=$top_srcdir/config
14
15
16 cleanup()
17 {
18      rm -rf $TEMPDIR
19 }
20
21
22 fail()
23 {
24     echo $activity
25     echo FAILED
26     cleanup;
27     exit 1;
28 }
29
30
31 no_result()
32 {
33     echo $activity
34     echo NO RESULT;
35     cleanup;
36     exit 2;
37 }
38
39 pass()
40 {
41     cleanup;
42     exit 0;
43 }
44
45 mkdir -p $TEMPDIR
46
47 activity="copy template 1" 
48 cp $top_srcdir/tests/bugs/recode-copy-bug-1.stat $TEMPDIR
49 if [ $? -ne 0 ] ; then no_result ; fi
50
51 activity="copy template 2" 
52 cp $top_srcdir/tests/bugs/recode-copy-bug-2.stat $TEMPDIR
53 if [ $? -ne 0 ] ; then no_result ; fi
54
55 activity="chdir"
56 cd $TEMPDIR
57 if [ $? -ne 0 ] ; then no_result ; fi
58
59
60 activity="run program"
61 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/recode-copy-bug-1.stat
62 if [ $? -ne 0 ] ; then no_result ; fi
63
64
65 activity="compare output"
66 diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-1.out
67 if [ $? -ne 0 ] ; then fail ; fi
68
69
70 activity="run program"
71 $SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/recode-copy-bug-2.stat
72 if [ $? -ne 0 ] ; then no_result ; fi
73
74
75 activity="compare output"
76 diff -b -B -w $TEMPDIR/pspp.list $top_srcdir/tests/bugs/recode-copy-bug-2.out
77 if [ $? -ne 0 ] ; then fail ; fi
78
79 pass;