Skip to content

test: ignore unused arguments in tests #1762

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

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

compnerd
Copy link
Member

What's in this pull request?

Resolved bug number: (SR-)


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
OS X platform @swift-ci Please test OS X platform
Linux platform @swift-ci Please test Linux platform

Note: Only members of the Apple organization can trigger swift-ci.

When invoking clang directly, with a newer clang, it is possible to get an
unused argument error failing the test. Silence this by telling clang to ignore
unused arguments. Since this is for testing purposes we are not too concerned
about ensuring that the exact set of arguments are supplied to the compiler.

@gribozavr
Copy link
Contributor

@swift-ci Please test

@compnerd
Copy link
Member Author

I don't have push rights, could you please take care of this for me?

@jrose-apple
Copy link
Contributor

-1 from me. I definitely want to know when I misspelled an argument and Clang allowed it through anyway.

@compnerd
Copy link
Member Author

@jrose-apple while I agree that would be nice, it doesn't always work out. I just disabled it for the case where there can be an error due to the unused argument (-fmodules-cache-path).

@jrose-apple
Copy link
Contributor

When is that unused?

@compnerd
Copy link
Member Author

@jrose-apple I ran into a couple of cases of this causing errors against a newer clang. I suppose that we could limit this to master-next, but, Im not sure that there is any harm in pushing this to master instead.

@jrose-apple
Copy link
Contributor

I maintain that this makes it harder to write new tests. We already ignore most warning output anyway, and it isn't an error, so why do we care?

@compnerd
Copy link
Member Author

I ran into a few cases where the unused option was an error for the clang importer. BTW, this doesn't disable the unknown warnings, it just permits adding options that are unused into the invocation.

@jrose-apple
Copy link
Contributor

Sorry, I'd like to see that there's not a reasonable workaround before accepting this.

@gottesmm
Copy link
Contributor

@compnerd I think we would rather catch those issues via this option and just update the tests.

@compnerd
Copy link
Member Author

compnerd commented Apr 4, 2016

Okay, in that case, the following tests were the ones that complained:

  • PrintAsObjC/cdecl.swift
  • PrintAsObjC/classes.swift
  • PrintAsObjC/empty.swift
  • PrintAsObjC/enums.swift
  • PrintAsObjC/simd.swift

Would it be preferable to add a new lit "tool" to avoid the -fmodule-cache-path?

@jrose-apple
Copy link
Contributor

If there's really just that few, I think it's best to just add -Qunused-arguments to those particular invocations that need to pass -fno-modules.

Thanks for looking into this, Saleem!

@compnerd compnerd force-pushed the squelch-arguments branch 2 times, most recently from 527f06c to d5e4c5e Compare April 5, 2016 17:00
These tests explicitly disable the use of modules.  However, the lit
configuration is such that the module cache path will be passed unconditionally
to the clang invocation.  Squelch the unused option warning (error).
@compnerd compnerd force-pushed the squelch-arguments branch from d5e4c5e to 89d37bc Compare April 5, 2016 17:00
@compnerd
Copy link
Member Author

compnerd commented Apr 5, 2016

@jrose-apple sounds reasonable to me; Ive uploaded a modified version of the change that just applies it on those particular tests. Happy to help :-).

@jrose-apple
Copy link
Contributor

Sanity-check time:

@swift-ci Please smoke test

@compnerd
Copy link
Member Author

compnerd commented Apr 6, 2016

@jrose-apple don't have push rights, would you mind pushing this for me?

@jrose-apple
Copy link
Contributor

Oops, meant to after the checks passed. Thanks!

@jrose-apple jrose-apple merged commit 4586af0 into swiftlang:master Apr 6, 2016
@compnerd compnerd deleted the squelch-arguments branch April 7, 2016 04:10
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.

4 participants