Skip to content
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

Update the backtrace parser for OCaml 4.11.0 #19

Merged
merged 1 commit into from
Jul 7, 2020

Conversation

Octachron
Copy link
Contributor

In OCaml 4.11, the backtrace has been updated to add function names whenever it is possible. For instance, in 4.11, a backtrace may look like

Called from OUnitRunner.run_one_test.(fun) in file "src/lib/ounit2/advanced/oUnitRunner.ml", line 83, characters 13-26

compared to

Called from file "src/lib/ounit2/advanced/oUnitRunner.ml", line 83, characters 13-26

in previous versions.

This change unfortunately breaks ounit backtrace parser.

This small PR proposes to update the parser to keep up with the improved backtrace messages.
The new Scanf format string is too clever for its own good but it works on all OCaml versions.

Close #17

@gildor478 gildor478 merged commit 2a9acf7 into gildor478:master Jul 7, 2020
@kit-ty-kate
Copy link
Contributor

Should this make all ounit releases previous to 2.2.3 incompatible with OCaml 4.11 or just on a per usage basis? I don't know how wildly this function used in ounit itself and outside.

@gildor478
Copy link
Owner

This is an optional feature that helps you to jump back where the test is defined. It is mostly for human.

Do you have bug report of people not being able to use the feature with older version of OCaml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OCaml 4.11 failure in tests: Should return a position.
3 participants