3 dnl Create a file "batch.sps" that is valid syntax only in batch mode.
4 m4_define([CREATE_BATCH_SPS],
5 [AT_DATA([batch.sps], [dnl
15 AT_SETUP([INSERT SYNTAX=INTERACTIVE])
17 AT_DATA([insert.sps], [dnl
23 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
24 batch.sps:2.1-2.4: error: INPUT PROGRAM: Syntax error at `loop': expecting end of command.
25 batch.sps:3: error: COMPUTE: COMPUTE is allowed only after the active dataset has been defined or inside INPUT PROGRAM.
26 batch.sps:4: error: END CASE: END CASE is allowed only inside INPUT PROGRAM.
27 insert.sps:4: error: LIST: LIST is allowed only after the active dataset has been defined.
31 AT_SETUP([INSERT SYNTAX=BATCH])
33 AT_DATA([insert.sps], [dnl
39 AT_CHECK([pspp -o pspp.csv insert.sps])
40 AT_CHECK([cat pspp.csv], [0], [dnl
51 AT_SETUP([INSERT CD=NO])
52 AT_DATA([insert.sps], [INSERT FILE='Dir1/foo.sps'.
56 AT_DATA([Dir1/foo.sps], [INSERT FILE='bar.sps' CD=NO.
58 AT_DATA([Dir1/bar.sps],
66 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
67 Dir1/foo.sps:1: error: INSERT: Can't find `bar.sps' in include file search path.
68 insert.sps:2: error: LIST: LIST is allowed only after the active dataset has been defined.
72 AT_SETUP([INSERT CD=YES])
73 AT_DATA([insert.sps], [INSERT FILE='Dir1/foo.sps' CD=YES.
77 AT_DATA([Dir1/foo.sps], [INSERT FILE='bar.sps'.
79 AT_DATA([Dir1/bar.sps],
87 AT_CHECK([pspp -o pspp.csv insert.sps])
88 AT_CHECK([cat pspp.csv], [0], [dnl
89 Table: Reading free-form data from INLINE.
101 m4_define([CREATE_ERROR_SPS],
102 [AT_DATA([error.sps], [dnl
103 DATA LIST NOTABLE LIST /x *.
110 * The following line is erroneous
116 AT_SETUP([INSERT ERROR=STOP])
118 AT_DATA([insert.sps], [INSERT FILE='error.sps' ERROR=STOP.
120 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
121 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
122 warning: Error encountered while ERROR=STOP is effective.
126 AT_SETUP([INSERT ERROR=CONTINUE])
128 AT_DATA([insert.sps], [INSERT FILE='error.sps' ERROR=CONTINUE.
130 AT_CHECK([pspp -o pspp.csv insert.sps], [1], [dnl
131 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
133 AT_CHECK([cat pspp.csv], [0], [dnl
134 error.sps:10: error: DISPLAY: AKSDJ is not a variable name.
144 dnl Test for regression against bug #24569 in which PSPP crashed
145 dnl upon attempt to insert a nonexistent file.
146 AT_SETUP([INSERT nonexistent file])
147 AT_DATA([insert.sps], [dnl
155 AT_CHECK([pspp -O format=csv insert.sps], [1], [dnl
156 insert.sps:2: error: INSERT: Can't find `nonexistent' in include file search path.
158 insert.sps:6: error: LIST: LIST is allowed only after the active dataset has been defined.