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

Add basic tests for MacVim #1454

Merged
merged 1 commit into from Oct 27, 2023

Conversation

ychin
Copy link
Member

@ychin ychin commented Oct 27, 2023

Add a few tests for MacVim using XCTest. Previously MacVim had essentially zero automatic tests. While we run the Vim tests in CI, those mostly exercise Vim features, not MacVim. These new tests are Objective C tests that are designed for MacVim-layer functionality instead. Only adding a few tests (both unit tests and integration tests) now to get started and set up a template for different types of tests but more will be added later.

Since MacVim consists of a lot of macOS API calls, a lot of those functionality are not easy to test automatically as they rely on behaviors out of MacVim's control (e.g. full screen functionality). The goal here is not to get 100% test coverage, but to catch areas prone to have regressions, code with non-straightforward logic, functionality that are annoying to manually test (e.g. key input), code blocks that perform calculations and can be easily unit tested. Areas that would be harder to add tests for include integration with macOS, e.g. full screen or dual monitor, interacting with the windowing system, or things that require screenshots in order to properly validate.

The goal here is to progressively add more tests as we touch different parts of MacVim to help catch regressions. Old code that works and isn't being touched will be lower priority as it's unlikely they will suddenly break.

Add a few tests for MacVim using XCTest. Previously MacVim had
essentially zero automatic tests. While we run the Vim tests in CI,
those mostly exercise Vim features, not MacVim. These new tests are
Objective C tests that are designed for MacVim-layer functionality
instead. Only adding a few tests (both unit tests and integration tests)
now to get started and set up a template for different types of tests
but more will be added later.

Since MacVim consists of a lot of macOS API calls, a lot of those
functionality are not easy to test automatically as they rely on
behaviors out of MacVim's control (e.g. full screen functionality). The
goal here is not to get 100% test coverage, but to catch areas prone to
have regressions, code with non-straightforward logic, functionality
that are annoying to manually test (e.g. key input), code blocks that
perform calculations and can be easily unit tested. Areas that would be
harder to add tests for include integration with macOS, e.g. full screen
or dual monitor, interacting with the windowing system, or things that
require screenshots in order to properly validate.

The goal here is to progressively add more tests as we touch different
parts of MacVim to help catch regressions. Old code that works and isn't
being touched will be lower priority as it's unlikely they will suddenly
break.
@ychin ychin added the Non User Facing Non-user facing change. These issues do no need to show up in release notes. label Oct 27, 2023
@ychin ychin added this to the Release 179 milestone Oct 27, 2023
@github-actions github-actions bot added the CI Vim upstream label for CI issues label Oct 27, 2023
@ychin
Copy link
Member Author

ychin commented Oct 27, 2023

I mentioned all the way back in 2018 that I was going to add more automatic testing for MacVim, so I guess I'm just 5 years late…

@ychin ychin merged commit 81d23bc into macvim-dev:master Oct 27, 2023
4 checks passed
@ychin ychin deleted the add-basic-macvim-objc-tests branch October 27, 2023 05:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Vim upstream label for CI issues Non User Facing Non-user facing change. These issues do no need to show up in release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant