editorscut / ec016swifttesting

This is the code repo that accompanies the SwiftTesting book
Creative Commons Zero v1.0 Universal
2 stars 0 forks source link

--enable-swift-testing doesn't work on MacOS 14.6.1 #2

Open DaveBrennanEMS opened 2 weeks ago

DaveBrennanEMS commented 2 weeks ago

Hi Daniel,

Following your swift testing book and when I get to page 34 and try to create a package using swift testing from the command line it fails

swift package init --type=library --enable-swift-testing error: Unknown option '--enable-swift-testing' Usage: swift package init [--type ] [--name ] See 'package init -help' for more information.

I'm currently running MacOS 14.6.1 is this why?

DaveBrennanEMS commented 2 weeks ago

When I try running swift test from the command line in the sample package directory it tells me I need swift tools 6 and I only have 5.10. I'm currently using 5.10 for production work. Can I have two versions of swift tools installed or is there no downside of installing the beta version of swift tools?

dimsumthinking commented 2 weeks ago

Sorry if you’re using Xcode 16 b5 we don’t need the flag anymore. Just type swift test.You need beta 5 or above for the bookOn Aug 24, 2024, at 11:18 AM, DaveBrennanEMS @.***> wrote: When I try running swift test from the command line in the sample package directory it tells me I need swift tools 6 and I only have 5.10. I'm currently using 5.10 for production work. Can I have two versions of swift tools installed or is there no downside of installing the beta version of swift tools?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

editorscut commented 2 weeks ago

Also I will check the book instructions to make sure I haven’t left in old information- thank youOn Aug 24, 2024, at 11:25 AM, dimsumthinking @.> wrote: Sorry if you’re using Xcode 16 b5 we don’t need the flag anymore. Just type swift test.You need beta 5 or above for the bookOn Aug 24, 2024, at 11:18 AM, DaveBrennanEMS @.> wrote:

When I try running swift test from the command line in the sample package directory it tells me I need swift tools 6 and I only have 5.10. I'm currently using 5.10 for production work. Can I have two versions of swift tools installed or is there no downside of installing the beta version of swift tools?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

DaveBrennanEMS commented 2 weeks ago

Sorry, perhaps I'm not being clear: I have Xcode 16 beta 6 installed next to Xcode 15.4 At the command line if I type swift test it tells me I need swift tools 6 and I have 5.10 If I try to init a package without the --enable-swift-testing flag I get an XCTest based set of tests If I try to init a package with the flag it says that flag is an unknown option How can I force the upgrade to swift tools 6 and if I do so will I still be able to use Xcode 15.4?

DaveBrennanEMS commented 2 weeks ago

Daniel,

I found the answer - by default even when you’re running Xcode 16 beta 6 Xcode doesn’t set the tools to v6 - they stay on 5.10. You can fix this by going to Xcode settings//locations and setting Command line tools to Xcode-beta 16.0. IF I used the command line tools more often I guess I would have known that. Anyway I guess this won’t be a problem in a couple of weeks as we’ll all be running Xcode 16 release.

There’s a typo on page 42 - rever should be refer

I am loving the book. I really like the whole command line approach to testing - it has great promise for automation and I wasn’t aware this was available.

I look forward to seeing your workshops at iOSDevUK next week.

Dave

On 24 Aug 2024, at 16:28, editorscut @.***> wrote:

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

Also I will check the book instructions to make sure I haven’t left in old information- thank youOn Aug 24, 2024, at 11:25 AM, dimsumthinking @.> wrote: Sorry if you’re using Xcode 16 b5 we don’t need the flag anymore. Just type swift test.You need beta 5 or above for the bookOn Aug 24, 2024, at 11:18 AM, DaveBrennanEMS @.> wrote:

When I try running swift test from the command line in the sample package directory it tells me I need swift tools 6 and I only have 5.10. I'm currently using 5.10 for production work. Can I have two versions of swift tools installed or is there no downside of installing the beta version of swift tools?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

— Reply to this email directly, view it on GitHubhttps://github.com/editorscut/ec016swifttesting/issues/2#issuecomment-2308430640, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AV7GQYZWY2PMRGJR472ZKGDZTCRAJAVCNFSM6AAAAABNBVNFQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGQZTANRUGA. You are receiving this because you authored the thread.Message ID: @.***>

editorscut commented 2 weeks ago

Thank you and I apologize for the time this cost you. I will insert some text to address this and fix the typo.See you soon!On Aug 26, 2024, at 7:28 PM, DaveBrennanEMS @.***> wrote: Daniel,

I found the answer - by default even when you’re running Xcode 16 beta 6 Xcode doesn’t set the tools to v6 - they stay on 5.10. You can fix this by going to Xcode settings//locations and setting Command line tools to Xcode-beta 16.0. IF I used the command line tools more often I guess I would have known that. Anyway I guess this won’t be a problem in a couple of weeks as we’ll all be running Xcode 16 release.

There’s a typo on page 42 - rever should be refer

I am loving the book. I really like the whole command line approach to testing - it has great promise for automation and I wasn’t aware this was available.

I look forward to seeing your workshops at iOSDevUK next week.

Dave

On 24 Aug 2024, at 16:28, editorscut @.***> wrote:

You don't often get email from @.*** Learn why this is importanthttps://aka.ms/LearnAboutSenderIdentification

Also I will check the book instructions to make sure I haven’t left in old information- thank youOn Aug 24, 2024, at 11:25 AM, dimsumthinking @.***> wrote:

Sorry if you’re using Xcode 16 b5 we don’t need the flag anymore. Just type swift test.You need beta 5 or above for the bookOn Aug 24, 2024, at 11:18 AM, DaveBrennanEMS @.***> wrote:

When I try running swift test from the command line in the sample package directory it tells me I need swift tools 6 and I only have 5.10. I'm currently using 5.10 for production work. Can I have two versions of swift tools installed or is there no downside of installing the beta version of swift tools?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

Reply to this email directly, view it on GitHubhttps://github.com/editorscut/ec016swifttesting/issues/2#issuecomment-2308430640, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AV7GQYZWY2PMRGJR472ZKGDZTCRAJAVCNFSM6AAAAABNBVNFQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBYGQZTANRUGA.

You are receiving this because you authored the thread.Message ID: @.***>

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>