Skip to content
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

[SR-4223] Use @testable in test release builds? #5071

Closed
Bouke opened this issue Mar 12, 2017 · 2 comments
Closed

[SR-4223] Use @testable in test release builds? #5071

Bouke opened this issue Mar 12, 2017 · 2 comments

Comments

@Bouke
Copy link
Contributor

Bouke commented Mar 12, 2017

Previous ID SR-4223
Radar None
Original Reporter @Bouke
Type New Feature
Status Resolved
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels New Feature
Assignee None
Priority Medium

md5: 17c94425cdb496a9ea9b17e3967b1735

duplicates:

  • SR-1354 [SwiftPM] Improve support for performance tests

Issue Description:

I have a test suite that takes quite a while to complete. This is because it uses the library "BigInt", a bignum library. I would always to use this library in release-build, as it is much faster. Tests run ~20x faster. However recently I started using "@testable" to access internal values. This doesn't seem to work with building release builds, as shown below.

I don't know how much sense it would make to be able to use "@testable" in release builds. However I would really like to have one of my dependencies to always build in release-build.

swift test -c release
Compile Swift Module 'SRP' (7 sources)
Compile Swift Module 'SRPTests' (4 sources)
/Users/bouke/Library/Mobile Documents/com~apple~CloudDocs/Developer/SRP/Tests/SRPTests/PySrptoolsTests.swift:5:18: error: module 'SRP' was not compiled for testing
@testable import SRP
@ankitspd
Copy link
Member

you can use swift test -c release -Xswiftc -enable-testing

@swift-ci
Copy link
Contributor

Comment by tanner0101 (JIRA)

@aciidb0mb3r thanks for that workaround. Do you think `swift test` could pass that flag automatically?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants