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
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,6 @@ data Args = Args {
68
68
,debug_parse::Bool
69
69
,testpaths:: [FilePath]
70
70
,print_::MaybeString
71
-
,actual::MaybeString
72
71
}deriving (Show, Data, Typeable)
73
72
74
73
argdefs =Args {
@@ -92,7 +91,6 @@ argdefs = Args {
92
91
,debug_parse = def &= help "Show test file parsing results and stop"
93
92
,testpaths = def &= args &= typ "TESTFILES|TESTDIRS"
94
93
,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). 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."
96
94
}
97
95
&= helpArg [explicit, name "help", name "h"]
98
96
&= program progname
@@ -155,8 +153,6 @@ checkArgs :: Args -> IO Args
155
153
checkArgs args =do
156
154
when (null$ testpaths args) $
157
155
warn $ printf "Please specify at least one test file or directory, eg: %s tests" progname
158
-
when (isJust (actual args) &¬ (isJust (print_ args))) $
159
-
warn "Option --actual can only be used with --print."
let errorMatch =maybeTrue (e_actual `matches`) e_expected
188
184
let exitCodeMatch =show x_actual `matches` x_expected
189
185
case print_ args of
190
-
Just format -> printShellTest format (actual args) st (mkEither outputMatch o_actual) (mkEither errorMatch e_actual) (mkEither exitCodeMatch x_actual)
186
+
Just format -> printShellTest format st
191
187
Nothing->if (x_actual ==127) -- catch bad executable - should work on posix systems at least
192
188
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
0 commit comments