Add support for swift test by gfontenot · Pull Request #205 · vim-test/vim-test · GitHub
Skip to content

Add support for swift test#205

Merged
janko merged 1 commit into
vim-test:masterfrom
gfontenot:gf-swift-package-manager
Jul 31, 2017
Merged

Add support for swift test#205
janko merged 1 commit into
vim-test:masterfrom
gfontenot:gf-swift-package-manager

Conversation

@gfontenot

Copy link
Copy Markdown
Contributor

Swift Package Manager ships a test runner that is accessible via swift test.
This commit adds support for working with swift test via vim-test.

There's definitely some fragility in here still that might need to get worked
out over time. Off the top of my head, some potential issues:

  • Users might locate their tests in a directory named something other than
    "Tests". Doing so would break the test file detection (and the module name
    parsing).
  • If users use a test lib like Quick, this won't properly parse module info
    (and filtering Quick tests with swift test doesn't work at all).

That being said, I think this is a good start, and getting this into the
plugin would mean being able to deploy fixes for these issues by tweaking the
regexes instead of needing to write this whole thing from scratch.

@gfontenot

Copy link
Copy Markdown
Contributor Author

@codeinabox codeinabox left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the PR. Could you also please update the README and doc/test.txt

Comment thread autoload/test/swift/swiftpm.vim Outdated
endfunction

function! s:parse_nearest_test_info(position)
let l:info = g:test#base#nearest_test(a:position, g:test#swift#patterns)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think you need to put this instead judging by the error

let l:info = test#base#nearest_test(a:position, g:test#swift#patterns)

@gfontenot

Copy link
Copy Markdown
Contributor Author

Fixed CI and added Swift support to the README. I didn't see anywhere obvious to update doc/test.txt. Happy to do that if you point me to what should be updated.

@codeinabox

Copy link
Copy Markdown
Collaborator

For doc/test.txt it's just a case of adding something like this amongst all the runner commands

                                                *test-: SwiftPM*
:SwiftPM [args]               Uses the `swift test` command.

Swift Package Manager ships a test runner that is accessible via `swift test`.
This commit adds support for working with `swift test` via vim-test.

There's definitely some fragility in here still that might need to get worked
out over time. Off the top of my head, some potential issues:

- Users might locate their tests in a directory named something other than
  "Tests". Doing so would break the test file detection (and the module name
  parsing).
- If users use a test lib like Quick, this won't properly parse module info
  (and filtering Quick tests with swift test doesn't work at all).

That being said, I think this is a good start, and getting this into the
plugin would mean being able to deploy fixes for these issues by tweaking the
regexes instead of needing to write this whole thing from scratch.
@gfontenot

Copy link
Copy Markdown
Contributor Author

Ah! My bad. Added that there now. I don't know why I didn't see that section.

@janko

janko commented Jul 31, 2017

Copy link
Copy Markdown
Member

@janko janko merged commit f2c5079 into vim-test:master Jul 31, 2017
@gfontenot gfontenot deleted the gf-swift-package-manager branch June 19, 2018 15:19
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.

3 participants