Unit testing a plug-in architecture
Unit testing a plug-in architecture
- Subject: Unit testing a plug-in architecture
- From: leenoori <email@hidden>
- Date: Thu, 14 Dec 2006 15:06:44 +0100
I have a project with unit tests and the following structure:
- Frameworks + unit tests for framework in separate bundles (one for
each framework)
- Application + unit tests for application in separate bundle
This approach is great because it allows me to keep my tests entirely
separate from my code, but always test the exact same code that ships
to the customers.
- The framework case is easy and clean: the test runner loads the
test framework, the framework to be tested, and the test bundle into
memory and runs the tests.
- The application is also easy and almost as clean: the application
runs, I inject the test framework and the bundle, and the tests run.
But I am not sure how to add unit tests for plug-ins that get loaded
into the application. The problem is that I am not sure how I can
maintain the clean separation between code (in the plug-in) and tests
(in a separate bundle). I can't just inject the test bundles into the
application because I don't know which plug-ins are going to be
enabled at the time the tests start running.
I am beginning to think that I may have to "pollute" my plug-ins with
test-related code; or rather, pollute the code in my application that
is responsible for loading plug-ins. Basically, I would have to add a
check for the presence of a test bundle for a plug-in when it loads
that plug-in, and if and only if the test framework has been loaded
into memory, explicitly run the tests for that bundle.
Is there a cleaner, more elegant way?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden