# \#cram

**URL:** https://discuss.ocaml.org/tag/cram/706.md

[Latest](https://discuss.ocaml.org/latest.md) · [Categories](https://discuss.ocaml.org/categories.md) · [Tags](https://discuss.ocaml.org/tags.md)

---

## [Shellcheck for Cram tests](https://discuss.ocaml.org/t/shellcheck-for-cram-tests/18551)

<div class="topic-metadata">

**Author:** [@amaro](https://discuss.ocaml.org/u/amaro)\
**Replies:** 1\
**Last updated:** [September 22, 2026, 5:58pm UTC](https://discuss.ocaml.org/t/shellcheck-for-cram-tests/18551 "2026-09-22T17:58:44Z")

</div>

When writing Cram tests, we end up making some mistakes, and using Shellcheck would allow us to avoid some of them. However, the format of run.t files does not currently allow running it “as is”. I tried doing some simp…

---

## [Dune Cram tests: preloading aliases/scripts](https://discuss.ocaml.org/t/dune-cram-tests-preloading-aliases-scripts/17610)

<div class="topic-metadata">

**Author:** [@amaro](https://discuss.ocaml.org/u/amaro)\
**Replies:** 5\
**Last updated:** [April 29, 2026, 1:55pm UTC](https://discuss.ocaml.org/t/dune-cram-tests-preloading-aliases-scripts/17610 "2026-04-29T13:55:05Z")

</div>

We are considering large-scale adoption of Cram tests, but we are missing some engineering features that are needed to ensure we don’t have to manually update hundreds of files when we need to apply some global changes. …

---

## [How to robustify Cram tests](https://discuss.ocaml.org/t/how-to-robustify-cram-tests/17752)

<div class="topic-metadata">

**Author:** [@amaro](https://discuss.ocaml.org/u/amaro)\
**Replies:** 5\
**Last updated:** [January 30, 2026, 3:53pm UTC](https://discuss.ocaml.org/t/how-to-robustify-cram-tests/17752 "2026-01-30T15:53:39Z")

</div>

Our usage of Cram tests in our codebase is steadily increasing, and with it, the issues related to not-well-written tests also increase. We are looking for ways to help ensure our tests are more robust. Note that this i…

---

## [Cram test errors and \*\*\*\* UNREACHABLE \*\*\*\*](https://discuss.ocaml.org/t/cram-test-errors-and-unreachable/17697)

<div class="topic-metadata">

**Author:** [@amaro](https://discuss.ocaml.org/u/amaro)\
**Replies:** 6\
**Last updated:** [January 15, 2026, 8:12pm UTC](https://discuss.ocaml.org/t/cram-test-errors-and-unreachable/17697 "2026-01-15T20:12:31Z")

</div>

Some kinds of errors in Dune Cram tests lead to a \*\*\*\*\* UNREACHABLE \*\*\*\*\* message, which makes it hard to debug what’s wrong. For instance: dune init proj foo cd foo mkdir cram.t echo " $ source foo.sh" \> cram.t/run.t…

---

## [Writing your cram tests in OCaml can be quite nice too](https://discuss.ocaml.org/t/writing-your-cram-tests-in-ocaml-can-be-quite-nice-too/16421)

<div class="topic-metadata">

**Author:** [@mbarbin](https://discuss.ocaml.org/u/mbarbin)\
**Replies:** 0\
**Last updated:** [April 3, 2025, 8:43am UTC](https://discuss.ocaml.org/t/writing-your-cram-tests-in-ocaml-can-be-quite-nice-too/16421 "2025-04-03T08:43:02Z")

</div>

I’ve seen some discuss around cram these days, and find it generally exciting that folks are talking about this form of testing. I wanted to make a small remark, based on a past experience. At some point I worked on a s…
