Skip to content

Add native unit test support for desktop in flutter/plugins #82445

@stuartmorgan-g

Description

@stuartmorgan-g

We're currently working on ensuring that most plugins have native unit tests set up (historically the focus has been on integration tests), which highlighted the fact that we don't currently have any solution in place for unit testing native desktop plugin code.

What we need for each platform (Windows, macOS, and Linux) is to:

  • decide on a unit testing framework
  • add a proof-of-concept to at least one plugin
  • add knowledge of how to run those tests to flutter_plugin_tools

My expectation is that we would likely use XCTest for macOS (it's already what we're using for iOS, so should be very straightforward), gtest or CTest for Linux (@robert-ancell, thoughts?), and likely the same for Windows as for Linux (since they both use CMake, so should be able to be similar, reducing the number of test systems people need to know).

/cc @cbracken

We could track this with separate issues per platform, but my hope is that this is going to be straightforward enough that we won't need to, and can just check of platforms here:

  • Windows
  • macOS
  • Linux

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopc: contributor-productivityTeam-specific productivity, code health, technical debt.p: toolingAffects the flutter_plugin_tools packagepackageflutter/packages repository. See also p: labels.platform-linuxBuilding on or for Linux specificallyplatform-macBuilding on or for macOS specificallyplatform-windowsBuilding on or for Windows specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions