3 # This program tests the CORRELATIONS command
5 TEMPDIR=/tmp/pspp-tst-$$
6 TESTFILE=$TEMPDIR/`basename $0`.sps
8 # ensure that top_srcdir and top_builddir are absolute
9 if [ -z "$top_srcdir" ] ; then top_srcdir=. ; fi
10 if [ -z "$top_builddir" ] ; then top_builddir=. ; fi
11 top_srcdir=`cd $top_srcdir; pwd`
12 top_builddir=`cd $top_builddir; pwd`
14 PSPP=$top_builddir/src/ui/terminal/pspp
16 STAT_CONFIG_PATH=$top_srcdir/config
17 export STAT_CONFIG_PATH
25 if [ x"$PSPP_TEST_NO_CLEANUP" != x ] ; then
26 echo "NOT cleaning $TEMPDIR"
60 activity="create program"
61 cat << EOF > $TESTFILE
63 data list notable list /foo * bar * wiz * bang *.
76 variables = foo bar wiz bang
88 variables = foo bar wiz bang
93 if [ $? -ne 0 ] ; then no_result ; fi
96 activity="run program"
97 $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE
98 if [ $? -ne 0 ] ; then no_result ; fi
100 activity="compare results"
101 perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list
102 cp $TEMPDIR/pspp.list /tmp
103 diff -b $TEMPDIR/pspp.list - << EOF
104 1.1 CORRELATIONS. Correlations
105 #========================#=====#=====#=====#=====#
106 # #foo |bar |wiz |bang #
107 #----+-------------------#-----+-----+-----+-----#
108 #foo |Pearson Correlation#1.000| .802| .890|-.308#
109 # |Sig. (2-tailed) # | .055| .017| .553#
110 #----+-------------------#-----+-----+-----+-----#
111 #bar |Pearson Correlation# .802|1.000| .519| .118#
112 # |Sig. (2-tailed) # .055| | .291| .824#
113 #----+-------------------#-----+-----+-----+-----#
114 #wiz |Pearson Correlation# .890| .519|1.000|-.344#
115 # |Sig. (2-tailed) # .017| .291| | .505#
116 #----+-------------------#-----+-----+-----+-----#
117 #bang|Pearson Correlation#-.308| .118|-.344|1.000#
118 # |Sig. (2-tailed) # .553| .824| .505| #
119 #====#===================#=====#=====#=====#=====#
120 2.1 CORRELATIONS. Correlations
121 #=======================#=====#=====#
123 #---+-------------------#-----+-----#
124 #bar|Pearson Correlation#1.000| .497#
125 # |Sig. (2-tailed) # | .210#
126 #---+-------------------#-----+-----#
127 #wiz|Pearson Correlation# .497|1.000#
128 # |Sig. (2-tailed) # .210| #
129 #===#===================#=====#=====#
130 3.1 CORRELATIONS. Correlations
131 #========================#=====#=====#=====#=====#
132 # #foo |bar |wiz |bang #
133 #----+-------------------#-----+-----+-----+-----#
134 #foo |Pearson Correlation#1.000| .805| .883|-.308#
135 # |Sig. (2-tailed) # | .029| .008| .553#
137 #----+-------------------#-----+-----+-----+-----#
138 #bar |Pearson Correlation# .805|1.000| .497| .164#
139 # |Sig. (2-tailed) # .029| | .210| .725#
141 #----+-------------------#-----+-----+-----+-----#
142 #wiz |Pearson Correlation# .883| .497|1.000|-.337#
143 # |Sig. (2-tailed) # .008| .210| | .460#
145 #----+-------------------#-----+-----+-----+-----#
146 #bang|Pearson Correlation#-.308| .164|-.337|1.000#
147 # |Sig. (2-tailed) # .553| .725| .460| #
149 #====#===================#=====#=====#=====#=====#
151 if [ $? -ne 0 ] ; then fail ; fi