Run doctests?

I’m guessing I’m missing something trivially obvious but haven’t found it–how can I run all doctests found in my code?

The Julia documentation references make -C doc doctest, but PkgDev.generate() does not create a makefile. The makefile for the Julia manual seems to run julia --color=yes docs/make.jl -- doctest, but as I understand Documenter, this requires manually adding each function to docs/src/

Is there a Julia equivalent to python test that runs all tests + doctests?

Many thanks!


I don’t know if there is a way to run a doctest without adding it to the docs. However you certainly don’t need to add each function manually, you can add everything automatically, see here.

This is a great tip, thank you! I’ve also made a feature request on the Juno github to add such a feature, here’s the link for anyone that’s interested:

Is there still no answer to that question, short of building the docs?

1 Like

There is doctest(::Module).


Package doctests can be run as a standard test like this, correct?

@testitem "Doctest" begin

Such that the doc tests are run when the package is tested?

Also, would this make the codecov consider the doc tests in the computation of coverage? (it seems that it does not).