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

Mock jl_generating_output as true in tests. #22

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Ismael-VC
Copy link
Contributor

No description provided.

@ssfrr
Copy link
Collaborator

ssfrr commented Jul 3, 2018

This seems like a good idea and should help boost test coverage.

It does change behavior a little though, as _jl_generating_output() will get called at macro expansion time rather than checking as part of the generated code. for instance, if I have

function foo()
    @suppress_out println("hello")
end

then _jl_generating_output() will get called when foo is compiled and replaced with a static true or false.

I'm not 100% sure under what conditions ccall(:jl_generating_output, Cint, ()) returns 0 or 1 so I don't know if this is a problem in practice, but it seems like it should check each time foo is called.

I think what we'd want is something more like !($(_jl_generating_output)()), or maybe !Suppressor._jl_generating_output()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants