ppx-errors test: avoid output variability due to user's .ocamlinit - #51
Merged
Conversation
When opam is installed the standard way, opam init creates ~/.ocamlinit containing '#use "topfind"'. When the custom toplevel (tt.exe) starts via Topmain.main(), it reads that file, which dynamically loads findlib_top.cma and calls Topfind.announce(), printing "Findlib has been successfully loaded..." to stdout and breaking the diff against test.out.expected. Fix: pass -noinit so the toplevel skips all init files. The flag has been available since OCaml 4.02 and the test is only enabled for >= 4.08, so there is no compatibility concern. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
I was getting spurious output from
#topfind;;in this test involving the toplevel, causing a test failure in some environments. The solution is to disable the loading of the user's.ocamlinitwhich is generally a good idea for test reproducibility.This change is also part of the more complex #47 (https://github.com/LexiFi/landmarks/pull/47/changes#diff-5c5c8d61086236b6ab5bc885c7ff38168f88423d03d55b4257e4c42364488ae2)