You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/shelltest.hs
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ argdefs = Args {
92
92
,debug_parse = def &= help "Show test file parsing results and stop"
93
93
,testpaths = def &= args &= typ "TESTFILES|TESTDIRS"
94
94
,print_ = def &= typ "FORMAT"&= opt "v3"&= groupname "Print test file"&= help "Print test files in specified format (default: v3)."
95
-
,actual = def &= typ "MODE"&= opt "all"&= help "Combined with --print, print test files with actual results (stdout, stderr, exit status). Mode 'all' prints all actual results (default). Mode 'update' prints actual results only for non-matching results, i.e. regular expressions in tests are retained."
95
+
,actual = def &= typ "MODE"&= opt "all"&= help "Combined with --print, print test files with actual results (stdout, stderr, exit status). This can be used to generate or update tests. Mode 'all' prints all actual results (default). Mode 'update' prints actual results only for non-matching results, i.e. regular expressions in tests are retained."
let outputMatch =maybeTrue (o_actual `matches`) o_expected
189
189
let errorMatch =maybeTrue (e_actual `matches`) e_expected
190
190
let exitCodeMatch =show x_actual `matches` x_expected
191
-
if (x_actual ==127) -- catch bad executable - should work on posix systems at least
192
-
thenioError$userError$unwords$filter (not.null) [e_actual, printf "Command: '%s' Exit code: %i" cmd x_actual] -- XXX still a test failure; should be an error
193
-
else assertString $concat$filter (not.null) [
191
+
if printTests
192
+
then printShellTest (actual args) st (mkEither outputMatch o_actual) (mkEither errorMatch e_actual) (mkEither exitCodeMatch x_actual)
193
+
elseif (x_actual ==127) -- catch bad executable - should work on posix systems at least
194
+
thenioError$userError$unwords$filter (not.null) [e_actual, printf "Command: '%s' Exit code: %i" cmd x_actual] -- XXX still a test failure; should be an error
195
+
else assertString $concat$filter (not.null) [
194
196
ifanynot [outputMatch, errorMatch, exitCodeMatch]
195
197
then printf "Command (at line %s):\n%s\n" (show ln) cmd
0 commit comments