# Ppx\_inline\_test and Makefiles

**URL:** <https://discuss.ocaml.org/t/ppx-inline-test-and-makefiles/5624>\
**Category:** Ecosystem\
**Tags:** ppx, findlib, ppx\_inline\_test, makefile\
**Created:** [April 26, 2020, 10:01pm UTC](https://discuss.ocaml.org/t/ppx-inline-test-and-makefiles/5624 "2020-04-26T22:01:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chet\_Murthy](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/chet_murthy/32/1501_2.png) [@Chet\_Murthy](https://discuss.ocaml.org/u/Chet_Murthy)\
**Post date:** [April 26, 2020, 10:01pm UTC](https://discuss.ocaml.org/t/ppx-inline-test-and-makefiles/5624/1 "2020-04-26T22:01:20Z")

</div>

[I’m debugging (dune’s \_build/log is useful here) and will undoubtedly be able to figure it out) but thought I’d ask just in case somebody else already figured it out]

I want to be able to run tests written using ppx\_inline\_test from a Makefile, using ocamlfind (of course). There seems to be no documentation on how to do this – does anybody have an example or hints?

ETA: nevermind, I figured it out. Here’s a simple Makefile that worked for me:

```auto

all: test_inline_test.ppx

test_inline_test.ppx: test_inline_test.ppx.byte
	./$< inline-test-runner foo -source-tree-root . -diff-cmd -

test_inline_test.ppx.byte: test_inline_test.cmo
	ocamlfind ocamlc -custom -package ppx_inline_test.runtime-lib,ppx_inline_test.runner.lib -linkpkg -linkall test_inline_test.cmo -o test_inline_test.ppx.byte

test_inline_test.cmo: test_inline_test.ml
	ocamlfind ppx_inline_test/ppx.exe -inline-test-lib foo ./test_inline_test.ml > test_inline_test.pp.ml
	ocamlfind ocamlc -verbose -package ppx_inline_test.runtime-lib -c test_inline_test.pp.ml -o test_inline_test.cmo

```

---

<div class="post-metadata">

**Author:** ![Kakadu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kakadu/32/1204_2.png) [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Post date:** [April 27, 2020, 7:23am UTC](https://discuss.ocaml.org/t/ppx-inline-test-and-makefiles/5624/2 "2020-04-27T07:23:00Z")

</div>

> [@Chet\_Murthy](#):
>
> ppx\_inline\_test

It would be great to add instructions to project’s README – for future generations.

---

<div class="post-metadata">

**Author:** ![domq](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/domq/32/2284_2.png) [@domq](https://discuss.ocaml.org/u/domq)\
**Post date:** [July 14, 2020, 5:21pm UTC](https://discuss.ocaml.org/t/ppx-inline-test-and-makefiles/5624/3 "2020-07-14T17:21:40Z")

</div>

Agreed 🙂 [https://github.com/janestreet/ppx\_inline\_test/pull/25](https://github.com/janestreet/ppx_inline_test/pull/25)
