Concise test output from PPX_expect?

I just started working on a pretty large codebase which uses ppx_expect for testing, all of which is pretty new to me. What I really need is a higher level idea of what is and isn’t working, but the current test output is roughly 4k lines with an overwhelming, difficult to parse amount of information.

I want something more like a name + pass/fail for each test, is that possible with ppx_expect? Should I use a custom test runner or is my only choice using like something like awk/sed to reduce the output to just the info I want?

1 Like

You can do small, named expect tests. This is how I usually see it used (and what is given as an example here GitHub - janestreet/ppx_expect: Cram like framework for OCaml).

Am I misunderstanding your question? Or possible you just happen to be looking at a gnarly test case? If you can share an example that could help clarify!

Oh sorry, I think I understand now. You don’t want to see the diff for each failing test but just whether it passed or failed?

It might be useful to paste an example of problematic behaviour (or maybe make it available on a GitHub repo somewhere) – just so we can see what you mean. Obviously, there’s the idea of “try to reduce the output bulkiness”. But I’m sure you’ve already gone down that path.

I personally really like mdx: I find it to be excellent for expect-test-like stuff, and have used it to wrote both tests and documentation, viz. the README for GitHub - camlp5/pa_ppx_regexp: Camlp5-compatible PPX rewriters for Perl-ish idiomatic regexps

I think that’s it. If you have a lot of tests and many of them failed, you have to trawl through the output to get a sense of all the failures and figure out what to fix first. If there was a ‘summary’ of all the failed tests at the bottom it would be easier to rerun specific ones and fix them one at a time. I often do this in Scala.

Makes sense. I don’t know how to get ppx expect to provide such a summary, but that could be a nice feature request or addition.