-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support local options in consoleOutput #232
Conversation
This was a first pass I did last night (before AoC took over). It seemed to do what I wanted quite well. It might be nice to go further and have only one console output mechanism, but I don't know that I understand all of your use cases. |
In particular, this addresses UnkindPartition#231 by allowing HideSuccesses to be honored at result reporting time.
I don't understand that appveyor failure, and I haven't figured out how to run your tests properly (I found the built executables and everything passes). |
This is redundant since consoleOutput is capable of deciding whether to hide successes granularly.
Optionally added a commit to remove |
Removing |
@@ -71,6 +71,7 @@ data TestOutput | |||
{- test name -} String | |||
{- print test name -} (IO ()) | |||
{- print test result -} (Result -> IO ()) | |||
{- get test options -} OptionSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you align this with the other comments please? :)
printResult r | ||
_ <- if resultSuccessful r && hideSuccesses | ||
then do pure $ Any False | ||
else do printName :: IO (); printResult r :: IO (); return $ Any True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any True and Any False don't do anything since the result is ignored. This hints at an issue: you are not erasing the empty headings like the original implementation did. Try compiling core-tests/hide-successes-test.hs
on master and your branch and compare the output.
streamOutputHidingSuccesses :: (?colors :: Bool) => TestOutput -> StatusMap -> IO () | ||
streamOutputHidingSuccesses toutput smap = | ||
void . flip evalStateT [] . getApp $ | ||
foldTestOutput foldTest foldHeading toutput smap | ||
where | ||
foldTest _name printName getResult printResult = | ||
foldTest _name printName getResult printResult _opts = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should update this function too; otherwise your new feature will work only in terminals.
57b36ec
to
4f7f586
Compare
I'm going to go ahead and close this. I don't think it's actually that important as I've found better ways to accomplish my goals. |
In particular, this addresses #231 by allowing HideSuccesses to be honored at result reporting time.