# V0.7 Pkg: Passing arguments to test

**URL:** <https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555>\
**Category:** Internals & Design\
**Created:** [July 21, 2018, 8:16am UTC](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555 "2018-07-21T08:16:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Post date:** [July 21, 2018, 8:16am UTC](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555/1 "2018-07-21T08:16:45Z")

</div>

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
$ julia ./test/runtests.jl <args>

```

But is it possible to do similar from REPL, like

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

```

?  
From julia REPL, I’m able to do

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

```

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

```julia
 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?

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [July 21, 2018, 1:34pm UTC](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555/2 "2018-07-21T13:34:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Post date:** [July 21, 2018, 2:56pm UTC](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555/3 "2018-07-21T14:56:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [February 25, 2021, 9:29am UTC](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555/4 "2021-02-25T09:29:03Z")

</div>

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

```julia
(@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=["

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [February 25, 2021, 9:33am UTC](https://discourse.julialang.org/t/v0-7-pkg-passing-arguments-to-test/12555/5 "2021-02-25T09:33:54Z")

</div>

```julia
julia> using Pkg

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

```
