Skip to content

avoid deprecation warnings from test discovery #3992

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
Jan 8, 2022

Conversation

tomerd
Copy link
Contributor

@tomerd tomerd commented Jan 8, 2022

motivation: do not prduce warning when tests are marked as deprecated, since they are designed to test deprecated functionality

changes:

  • mark generated test-discovery wrappers as psuedo-deprecated so they dont produce deprecation warnings
  • use @main for the test discovery entry point instead of main.swift which helps avoid deprecation warnings at the entry point
  • cleanup test discovery generate names to be easier to reason about
  • add and adjust tests for throwing variants
  • add test for deprecation use case

motivation: do not prduce warning when tests are marked as deprecated, since they are designed to test deprecated functionality

changes:
* mark generated test-discovery wrappers as psuedo-deprecated so they dont produce deprecation warnings
* use @main for the test discovery entry point instead of main.swift which helps avoid deprecation warnings at the entry point
* cleanup test discovery generate  names to be easier to reason about
* add and adjust tests for throwing variants
* add test for deprecation use case
@tomerd
Copy link
Contributor Author

tomerd commented Jan 8, 2022

@swift-ci please smoke test

@tomerd
Copy link
Contributor Author

tomerd commented Jan 8, 2022

@Lukasa iirc you filed a jira/radar on this? could not find it! do you happen to have a link so I can associate with the fix?

@tomerd tomerd added the ready Author believes the PR is ready to be merged & any feedback has been addressed label Jan 8, 2022
@tomerd tomerd merged commit bf733be into swiftlang:main Jan 8, 2022
tomerd added a commit to tomerd/swift-package-manager that referenced this pull request Jan 8, 2022
motivation: small follow up cleanup to swiftlang#3992 which consolidates the use of a share defintiion for the main file used for test discovery

changes: use the shared defintiion for the main file name used for test discovery everywhere
tomerd added a commit to tomerd/swift-package-manager that referenced this pull request Jan 8, 2022
motivation: do not prduce warning when tests are marked as deprecated, since they are designed to test deprecated functionality

changes:
* mark generated test-discovery wrappers as psuedo-deprecated so they dont produce deprecation warnings
* use @main for the test discovery entry point instead of main.swift which helps avoid deprecation warnings at the entry point
* cleanup test discovery generate  names to be easier to reason about
* add and adjust tests for throwing variants
* add test for deprecation use case
tomerd added a commit that referenced this pull request Jan 9, 2022
motivation: small follow up cleanup to #3992 which consolidates the use of a share defintiion for the main file used for test discovery

changes: use the shared defintiion for the main file name used for test discovery everywhere
tomerd added a commit to tomerd/swift-package-manager that referenced this pull request Jan 9, 2022
motivation: small follow up cleanup to swiftlang#3992 which consolidates the use of a share defintiion for the main file used for test discovery

changes: use the shared defintiion for the main file name used for test discovery everywhere
tomerd added a commit that referenced this pull request Jan 9, 2022
motivation: do not prduce warning when tests are marked as deprecated, since they are designed to test deprecated functionality

changes:
* mark generated test-discovery wrappers as psuedo-deprecated so they dont produce deprecation warnings
* use @main for the test discovery entry point instead of main.swift which helps avoid deprecation warnings at the entry point
* cleanup test discovery generate  names to be easier to reason about
* add and adjust tests for throwing variants
* add test for deprecation use case
tomerd added a commit that referenced this pull request Jan 9, 2022
motivation: small follow up cleanup to #3992 which consolidates the use of a share defintiion for the main file used for test discovery

changes: use the shared defintiion for the main file name used for test discovery everywhere
@Lukasa
Copy link
Contributor

Lukasa commented Jan 11, 2022

Sorry for the delay, @weissi filed the issue: https://bugs.swift.org/browse/SR-12008.

glbrntt added a commit to glbrntt/swift-package-manager that referenced this pull request Mar 17, 2022
Motivation:

In swiftlang#3992 the class
name was stripped from the static array of tests (i.e.
`__allTests_CLASSNAME` became `__allTests`). The class name ensured the
variable was uniquely named. Without it, in a test class which is
derived from another, it is not unique and results in compile-time
errors.

Modifications:

- Reintroduce the class name
- Add tests

Result:

Dervied test classes do not result in compilation errors on Linux.
glbrntt added a commit to glbrntt/swift-package-manager that referenced this pull request Mar 17, 2022
Motivation:

In swiftlang#3992 the class
name was stripped from the static array of tests (i.e.
`__allTests_CLASSNAME` became `__allTests`). The class name ensured the
variable was uniquely named. Without it, in a test class which is
derived from another, it is not unique and results in compile-time
errors.

Modifications:

- Reintroduce the class name
- Add tests

Result:

Dervied test classes do not result in compilation errors on Linux.
tomerd pushed a commit that referenced this pull request Mar 17, 2022
Motivation:

In #3992 the class
name was stripped from the static array of tests (i.e.
`__allTests_CLASSNAME` became `__allTests`). The class name ensured the
variable was uniquely named. Without it, in a test class which is
derived from another, it is not unique and results in compile-time
errors.

Modifications:

- Reintroduce the class name
- Add tests

Result:

Dervied test classes do not result in compilation errors on Linux.
glbrntt added a commit to glbrntt/swift-package-manager that referenced this pull request Mar 18, 2022
Motivation:

In swiftlang#3992 the class
name was stripped from the static array of tests (i.e.
`__allTests_CLASSNAME` became `__allTests`). The class name ensured the
variable was uniquely named. Without it, in a test class which is
derived from another, it is not unique and results in compile-time
errors.

Modifications:

- Reintroduce the class name
- Add tests

Result:

Dervied test classes do not result in compilation errors on Linux.
glbrntt added a commit to glbrntt/swift-package-manager that referenced this pull request Mar 18, 2022
Motivation:

In swiftlang#3992 the class
name was stripped from the static array of tests (i.e.
`__allTests_CLASSNAME` became `__allTests`). The class name ensured the
variable was uniquely named. Without it, in a test class which is
derived from another, it is not unique and results in compile-time
errors.

Modifications:

- Reintroduce the class name
- Add tests

Result:

Dervied test classes do not result in compilation errors on Linux.

(cherry picked from commit 27cd3df)
glbrntt added a commit that referenced this pull request Mar 23, 2022
Motivation:

In #3992 the class
name was stripped from the static array of tests (i.e.
`__allTests_CLASSNAME` became `__allTests`). The class name ensured the
variable was uniquely named. Without it, in a test class which is
derived from another, it is not unique and results in compile-time
errors.

Modifications:

- Reintroduce the class name
- Add tests

Result:

Dervied test classes do not result in compilation errors on Linux.

(cherry picked from commit 27cd3df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants