Alcotest.run: ensure and_exit and record_backtrace can be overriden f…#439
Open
edwintorok wants to merge 1 commit into
Open
Alcotest.run: ensure and_exit and record_backtrace can be overriden f…#439edwintorok wants to merge 1 commit into
edwintorok wants to merge 1 commit into
Conversation
…or the test sub-command too `default_cmd` handles this correctly, but `test_cmd` always set `and_exit` and `record_backtrace` to `true`. Due to `Config.User.(cli_config || config)` this meant that `and_exit` couldn't be set to `false` by the caller. The main program may want to set `and_exit` to false if it has some wrappers using `Fun.protect` for example, with `and_exit` set to true these wouldn't run. For backwards compatibility with old versions of alcotest one workaround is to use `at_exit` instead of `Fun.protect` to register cleanup handlers. Fixes mirage#438 Signed-off-by: Edwin Török <edwin@tarides.com>
Contributor
Author
|
The CI needs some maintenance due to the removal of <4.11 from opam-repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…or the test sub-command too
default_cmdhandles this correctly, buttest_cmdalways setand_exitandrecord_backtracetotrue.Due to
Config.User.(cli_config || config)this meant thatand_exitcouldn't be set tofalseby the caller.The main program may want to set
and_exitto false if it has some wrappers usingFun.protectfor example, withand_exitset to true these wouldn't run.For backwards compatibility with old versions of alcotest one workaround is to use
at_exitinstead ofFun.protectto register cleanup handlers.Fixes #438