V0.7 Pkg: Passing arguments to test

Hi,

Is there any way to pass arguments to test scripts when called via the Pkg REPL?
From command line, I’m able to do

$ julia ./test/runtests.jl <args>

But is it possible to do similar from REPL, like

(v0.7) pkg> test <PackageName> <args>

?
From julia REPL, I’m able to do

ARGS = [ <args> ]; include( joinpath(Pkg.dir(<PackageName>),"test","runtests.jl") )

Even though this works now, there is a warning displayed:

 Warning: Pkg.dir is only kept for legacy CI script reasons
└ @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/Pkg/src/API.jl:433

So what is the “right way” to pass arguments to test script in v0.7?

1 Like

Can you file an issue on the Pkg.jl repo?

2 Likes

Thanks.
I have opened a new issue at https://github.com/JuliaLang/Pkg.jl/issues/518

1 Like

As of Julia 1.6, which is the “final” way to pass argument to testing using the package mode ?

(@v1.6) pkg> test BetaML all
ERROR: The following package names could not be resolved:
 * all (not found in project or manifest)


(@v1.6) pkg> test BetaML --test_args all
ERROR: Unable to parse `--test_args` as a package.

(@v1.6) pkg> test BetaML test_args all
ERROR: The following package names could not be resolved:
 * all (not found in project or manifest)
 * test_args (not found in project or manifest)


(@v1.6) pkg> test BetaML --all
ERROR: Unable to parse `--all` as a package.

(@v1.6) pkg> test BetaML -- all
ERROR: Unable to parse `--` as a package.

(@v1.6) pkg> test BetaML --test-args arg1 arg2
ERROR: Unable to parse `--test-args` as a package.

(@v1.6) pkg> test --test_args=[all] BetaML
ERROR: malformed option: "--test_args=[all]"

(@v1.6) pkg> test --test_args=["all"] BetaML
ERROR: malformed option: "--test_args=["
julia> using Pkg

julia> Pkg.test("BetaML", test_args = ["all"])
3 Likes