Internal Tests


(Daniel Eggert) #1

Is it ok to use
    @testable import SwiftFoundation
in tests? I'd like to test some internal code.

TestNSXMLDocument.swift uses this, but not on Linux. What's the reason for this?

/Daniel


(Tony Parker) #2

Using @testable makes sense to me. Let's try it out.

- Tony

···

On Mar 15, 2016, at 7:54 AM, Robert Stephen Thompson via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

If it doesn’t use it on Linux, it’s because I was mostly running tests in Xcode heh, and didn’t end up needing it in the end. On Linux, of course, I think you’d want @testable import Foundation. I’m not an Apple guy, though, I just happen to be the guy who wrote TestNSXMLDocument.swift! So if there is actually a reason not to use it, I’m not aware of it, but don’t necessarily take my word for it!

Thanks,
Robert Thompson
Software Engineer
WillowTree, Inc.®
willowtreeapps.com

On Mar 15, 2016, at 8:02 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Is it ok to use
   @testable import SwiftFoundation
in tests? I'd like to test some internal code.

TestNSXMLDocument.swift uses this, but not on Linux. What's the reason for this?

/Daniel

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


(Robert Thompson) #3

If it doesn’t use it on Linux, it’s because I was mostly running tests in Xcode heh, and didn’t end up needing it in the end. On Linux, of course, I think you’d want @testable import Foundation. I’m not an Apple guy, though, I just happen to be the guy who wrote TestNSXMLDocument.swift! So if there is actually a reason not to use it, I’m not aware of it, but don’t necessarily take my word for it!

Thanks,
Robert Thompson
Software Engineer
WillowTree, Inc.®
willowtreeapps.com <http://willowtreeapps.com/>

···

On Mar 15, 2016, at 8:02 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

Is it ok to use
   @testable import SwiftFoundation
in tests? I'd like to test some internal code.

TestNSXMLDocument.swift uses this, but not on Linux. What's the reason for this?

/Daniel

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


(Pushkar N Kulkarni) #4

@testable doesn’t work with Foundation. I get this build error:

TestFoundation/TestNSURLSession.swift:17:22: error: module ‘Foundation’ was not compiled for testing

@testable import Foundation

Is there an equivalent for Xcode’s “Enable Testability” on Linux?

Pushkar N Kulkarni,

IBM Runtimes

Simplicity is prerequisite for reliability - Edsger W. Dijkstra

Using @testable makes sense to me. Let’s try it out.

  • Tony
···

On Mar 15, 2016, at 7:54 AM, Robert Stephen Thompson via swift-corelibs-dev swift-corelibs-dev@swift.org wrote:

If it doesn’t use it on Linux, it’s because I was mostly running tests in Xcode heh, and didn’t end up needing it in the end. On Linux, of course, I think you’d want @testable import Foundation. I’m not an Apple guy, though, I just happen to be the guy who wrote TestNSXMLDocument.swift! So if there is actually a reason not to use it, I’m not aware of it, but don’t necessarily take my word for it!

Thanks,

Robert Thompson

Software Engineer

WillowTree, Inc.®

willowtreeapps.com

On Mar 15, 2016, at 8:02 AM, Daniel Eggert via swift-corelibs-dev swift-corelibs-dev@swift.org wrote:

Is it ok to use
@testable import SwiftFoundation
in tests? I’d like to test some internal code.

TestNSXMLDocument.swift uses this, but not on Linux. What’s the reason for this?

/Daniel


swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev


swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

To: Robert Stephen Thompson robert.thompson@willowtreeapps.com
From: Tony Parker via swift-corelibs-dev
Sent by: swift-corelibs-dev-bounces@swift.org
Date: 03/15/2016 08:42PM
Cc: Swift corelibs dev swift-corelibs-dev@swift.org
Subject: Re: [swift-corelibs-dev] Internal Tests

-----swift-corelibs-dev-bounces@swift.org wrote: -----


(Tony Parker) #5

Hm, that’s too bad. Do we just need to add a flag to Foundation’s build script?

- Tony

···

On Jul 8, 2016, at 12:26 AM, Pushkar N Kulkarni <pushkar.nk@in.ibm.com> wrote:

@testable doesn't work with Foundation. I get this build error:

TestFoundation/TestNSURLSession.swift:17:22: error: module 'Foundation' was not compiled for testing

    @testable import Foundation

Is there an equivalent for Xcode's "Enable Testability" on Linux?

Pushkar N Kulkarni,
IBM Runtimes

Simplicity is prerequisite for reliability - Edsger W. Dijkstra

-----swift-corelibs-dev-bounces@swift.org <mailto:-----swift-corelibs-dev-bounces@swift.org> wrote: -----
To: Robert Stephen Thompson <robert.thompson@willowtreeapps.com <mailto:robert.thompson@willowtreeapps.com>>
From: Tony Parker via swift-corelibs-dev
Sent by: swift-corelibs-dev-bounces@swift.org <mailto:swift-corelibs-dev-bounces@swift.org>
Date: 03/15/2016 08:42PM
Cc: Swift corelibs dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>>
Subject: Re: [swift-corelibs-dev] Internal Tests

Using @testable makes sense to me. Let's try it out.

- Tony

On Mar 15, 2016, at 7:54 AM, Robert Stephen Thompson via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

If it doesn’t use it on Linux, it’s because I was mostly running tests in Xcode heh, and didn’t end up needing it in the end. On Linux, of course, I think you’d want @testable import Foundation. I’m not an Apple guy, though, I just happen to be the guy who wrote TestNSXMLDocument.swift! So if there is actually a reason not to use it, I’m not aware of it, but don’t necessarily take my word for it!

Thanks,
Robert Thompson
Software Engineer
WillowTree, Inc.®
willowtreeapps.com <http://willowtreeapps.com/>

On Mar 15, 2016, at 8:02 AM, Daniel Eggert via swift-corelibs-dev <swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>> wrote:

Is it ok to use
   @testable import SwiftFoundation
in tests? I'd like to test some internal code.

TestNSXMLDocument.swift uses this, but not on Linux. What's the reason for this?

/Daniel

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev

_______________________________________________
swift-corelibs-dev mailing list
swift-corelibs-dev@swift.org <mailto:swift-corelibs-dev@swift.org>
https://lists.swift.org/mailman/listinfo/swift-corelibs-dev