Skip to content

[stdlib] Migrate stdlib tests of Swift 3 #17427

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 4 commits into from
Jul 8, 2018

Conversation

airspeedswift
Copy link
Member

@airspeedswift airspeedswift commented Jun 22, 2018

PR to gather std lib tests that use Swift 3.

  • Some need switching from 3 to 4, with source tweaks
  • Some just need deleting because they were testing 3-only stuff
  • Some test multiple versions and need 3 removing

Feel free to join the party.

@airspeedswift
Copy link
Member Author

@swift-ci please test

@@ -595,11 +595,9 @@ DispatchAPI.test("DispatchTimeInterval") {
expectTrue(t == t) // This would crash.
}

#if swift(>=4.0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove the RUN: line for -swift-version 3 too?

@@ -1,5 +1,5 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -o %t/a.out3 -swift-version 3 && %target-run %t/a.out3
// RUN: %target-build-swift %s -o %t/a.out -swift-version 3 && %target-run %t/a.out
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be -swift-version 4?

Copy link
Member Author

Choose a reason for hiding this comment

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

ah in fact the whole test should just go, we don't support this beyond Swift 3

@slavapestov
Copy link
Contributor

Thanks for working on this!

@milseman
Copy link
Member

Some of these changes are to explicitly check legacy support for users of -swift-version 3. Is your intention for us to not test this mode at all, or just to migrate stale tests?

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

Big thumbs up!

// RUN: %target-build-swift %s -o %t/a.out4 -swift-version 4 && %target-run %t/a.out4

// REQUIRES: executable_test

import StdlibUnittest

#if swift(>=4)

public typealias ExpectedResultType = [Character]
let swiftVersion = "4"
Copy link
Member

Choose a reason for hiding this comment

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

Nit: I think we should remove these two variables now; they make it slightly harder to understand the tests.

@airspeedswift airspeedswift force-pushed the stdlib-swift-4-tests branch from 20b0b56 to 41e05d4 Compare July 5, 2018 15:12
@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift airspeedswift changed the title [stdlib][WIP] Migrate stdlib tests of Swift 3 [stdlib] Migrate stdlib tests of Swift 3 Jul 5, 2018
@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 41e05d41aad9a2b041519a88f0a4a19dfcb07d13

@airspeedswift
Copy link
Member Author

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 41e05d41aad9a2b041519a88f0a4a19dfcb07d13

@airspeedswift
Copy link
Member Author

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 41e05d41aad9a2b041519a88f0a4a19dfcb07d13

@airspeedswift
Copy link
Member Author

@swift-ci please clean test linux platform

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 41e05d41aad9a2b041519a88f0a4a19dfcb07d13

@airspeedswift airspeedswift force-pushed the stdlib-swift-4-tests branch from 41e05d4 to 6dc812b Compare July 5, 2018 20:18
@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - 41e05d41aad9a2b041519a88f0a4a19dfcb07d13

@swift-ci
Copy link
Contributor

swift-ci commented Jul 5, 2018

Build failed
Swift Test Linux Platform
Git Sha - 41e05d41aad9a2b041519a88f0a4a19dfcb07d13

@airspeedswift airspeedswift force-pushed the stdlib-swift-4-tests branch 2 times, most recently from ae6ded1 to 387ca22 Compare July 6, 2018 18:35
@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 6, 2018

Build failed
Swift Test Linux Platform
Git Sha - f7ab8ca87135fe50f4f16357aca0af969772d96d

@@ -475,8 +475,7 @@ func getBridgedNSDictionaryOfRefTypesBridgedVerbatim() -> NSDictionary {
d[TestObjCKeyTy(20)] = TestObjCValueTy(1020)
d[TestObjCKeyTy(30)] = TestObjCValueTy(1030)

let bridged =
unsafeBitCast(convertDictionaryToNSDictionary(d), to: NSDictionary.self)
Copy link
Member Author

Choose a reason for hiding this comment

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

@lorentey just to check, can you spot any higher purpose to this bit cast that I'm missing? The function already returns an NSDictionary.

Copy link
Member

Choose a reason for hiding this comment

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

There is none as far as I can tell!

@airspeedswift
Copy link
Member Author

@swift-ci please test linux platform

@airspeedswift airspeedswift force-pushed the stdlib-swift-4-tests branch from 387ca22 to f5d938a Compare July 8, 2018 00:23
@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - 387ca22eb7d4c2ef5423f0e63afeeb7091d0e545

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2018

Build failed
Swift Test OS X Platform
Git Sha - 387ca22eb7d4c2ef5423f0e63afeeb7091d0e545

@airspeedswift
Copy link
Member Author

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

swift-ci commented Jul 8, 2018

Build failed
Swift Test Linux Platform
Git Sha - f5d938a

@airspeedswift
Copy link
Member Author

@swift-ci please test Linux platform

@airspeedswift
Copy link
Member Author

Finally™️

@airspeedswift airspeedswift merged commit 685f31b into swiftlang:master Jul 8, 2018
@airspeedswift airspeedswift deleted the stdlib-swift-4-tests branch July 8, 2018 16:37
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.

5 participants