File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -158,5 +158,42 @@ pushd cpp_files
158
158
" $fpm " test
159
159
popd
160
160
161
+ # Test app exit codes
162
+ pushd fpm_test_exit_code
163
+ " $fpm " build
164
+
165
+ # odd number -> return 0
166
+ EXIT_CODE=0
167
+ " $fpm " run -- 1 || EXIT_CODE=$?
168
+ test $EXIT_CODE -eq 0
169
+
170
+ # even number -> return 3
171
+ EXIT_CODE=0
172
+ " $fpm " run -- 512 || EXIT_CODE=$?
173
+ test $EXIT_CODE -eq 3
174
+
175
+ # even number -> return 3
176
+ EXIT_CODE=0
177
+ " $fpm " run -- 0 || EXIT_CODE=$?
178
+ test $EXIT_CODE -eq 3
179
+
180
+ # not an integer -> return 3
181
+ EXIT_CODE=0
182
+ " $fpm " run -- 3.1415 || EXIT_CODE=$?
183
+ test $EXIT_CODE -eq 2
184
+
185
+ # not a number
186
+ EXIT_CODE=0
187
+ " $fpm " run -- notanumber || EXIT_CODE=$?
188
+ test $EXIT_CODE -eq 2
189
+
190
+ # no arguments
191
+ EXIT_CODE=0
192
+ " $fpm " run || EXIT_CODE=$?
193
+ test $EXIT_CODE -eq 1
194
+
195
+ popd
196
+
197
+
161
198
# Cleanup
162
199
rm -rf ./* /build
You can’t perform that action at this time.
0 commit comments