I have written a package along with some unit tests, which I would like to be able to run once the package is added to Julia. But I get an error:
pkg> add gitlink-to-PackageName
pkg> test PackageName
ERROR: LoadError: ArgumentError: Package Test not found in current path:
- Run `import Pkg; Pkg.add("Test")` to install the Test package.
I do: pkg> add Test
which adds Test to the package list, but still ‘test PackageName’ fails with the same error.
I am using Julia 1.2.0. I can run tests on other packages I have installed.
Questions:
- What step am I missing, so the ‘Test’ package I load in ‘pkg’ is available to my package’s ‘runtests’?
- Why does ‘Test’ need installing separately, if it’s in the stdlib?
I am following the (possibly outdated) page: Finalizing Your Julia Package: Documentation, Testing, Coverage, and Publishing - Stochastic Lifestyle
I had to replace ‘using Base.Test’ with ‘using Test’, but apart from that,
- PackageName/src has my code
- PackageName/test has ‘runtests.jl’
$ julia test/runtests.jl runs and shows all tests passing.