Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Consider an option to codegen XCTTests #20

Open
schwa opened this issue May 2, 2020 · 1 comment
Open

Consider an option to codegen XCTTests #20

schwa opened this issue May 2, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@schwa
Copy link

schwa commented May 2, 2020

As a big fan of python doctests I actually had a proof of concept swift doctest working a few years ago. I didn’t get much beyond proof of concept (although I do have some doctest comments still sprinkled in my codebase). One difference between your doctest and mine was that my version didn’t try to run the tests - it would merely codegen XCTest files that you could include and run as part of your normal unit test phase.

I definitely see the advantage of doctest being used to run the tests - but using it for codegen-ing removes some of burden of installing another tool, integrates well with other testing tools/CI etc and allows users to migrate away from doctest if it for whatever reason it doesn’t work out for them.

Just a suggestion of course.

@mattt mattt added the enhancement New feature or request label May 4, 2020
@mattt
Copy link
Contributor

mattt commented May 4, 2020

I agree that this would be a useful feature. I'd say the story for code generation in Swift is only "so-so" right now. Template-based systems like Sourcery have their uses, but I don't think it'd be a great fit here. I think SwiftSyntaxBuilder is really promising, and I hope that gets some more attention soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants