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

Ensure --depwarn=yes by default in Pkg.test #1763

Merged
merged 2 commits into from
Apr 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ function gen_test_code(testfile::String;
--color=$(Base.have_color === nothing ? "auto" : Base.have_color ? "yes" : "no")
--compiled-modules=$(Bool(Base.JLOptions().use_compiled_modules) ? "yes" : "no")
--check-bounds=yes
--depwarn=$(Base.JLOptions().depwarn == 2 ? "error" : "yes")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I have started Julia explicitly with --depwarn=no it would be nice to propagate that too, but maybe that info is not available as for other options?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem like it is available. Guess you need to just pass it explicitly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep there's not much we can do about this without considerably complicating Base.JLOptions() with the ability to distinguish between default vs explicitly specified options.

--inline=$(Bool(Base.JLOptions().can_inline) ? "yes" : "no")
--startup-file=$(Base.JLOptions().startupfile == 1 ? "yes" : "no")
--track-allocation=$(("none", "user", "all")[Base.JLOptions().malloc_log + 1])
Expand Down
1 change: 1 addition & 0 deletions test/test_packages/TestArguments/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@assert ARGS == ["a", "b"]
@assert Base.JLOptions().quiet == 1 # --quiet
@assert Base.JLOptions().check_bounds == 2 # overriden default when testing
@assert Base.JLOptions().depwarn == 1 # Default to depwarn on