Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give examples of using julia_args, test_args #2673

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/Pkg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,32 @@ test = ["Test"]
The tests are executed in a new process with `check-bounds=yes` and by default `startup-file=no`.
If using the startup file (`~/.julia/config/startup.jl`) is desired, start julia with `--startup-file=yes`.
Inlining of functions during testing can be disabled (for better coverage accuracy)
by starting julia with `--inline=no`.
by starting julia with `--inline=no`. The tests can be run as if different command line arguments were
passed to julia by passing the arguments instead to the `julia_args` keyword argument, e.g.

```
Pkg.test("foo"; julia_args=["--inline"])
```

To pass some command line arguments to be used in the tests themselves, pass the arguments to the
`test_args` keyword argument. These could be used to control the code being tested, or to control the
tests in some way. For example, if the tests define a macro

```
macro long(code)
if "--long" in ARGS
:( $code )
end
end
```

Then some tests that take a long time to run could be marked with the macro like `@long @test foo == bar`
and they would only be run if the argument `--long` was passed either to Julia on the command line (or by
modifying `ARGS`), or by passing it using `test_args`, e.g.

```
Pkg.test("foo"; test_args=["--long"])
```
johnomotani marked this conversation as resolved.
Show resolved Hide resolved
"""
const test = API.test

Expand Down