Friday, July 24, 2009

SWX Batch mode Integrated Tests with CEEFIT

If you have read any of my previous posts on Testing CAD Plugins, then you are aware of what I am trying to accomplish - an automated Integrated Test framework to test, at the very least, SolidWorks API Plugins. The following are some of the more relevant posts regarding Testing CAD Plugins:

Some of you have even downloaded the sample workspace "" posted in one of the posts above (Batch mode SolidWorks). For convenience the following is the "" file.

If you prefer to download from the source, you can do so using the following link with your SVN client (e.g. TortoiseSVN (follow the instructions at


The Pursuit of "CAD Plugin Testingness"
With this post I continue my pursuit of an automated Integrated Test Framework, using CEEFIT and dare I say it, I have come quite close to achieving my goal (my wishlist of sub-goals not yet achieved are listed at the end of this post).

Download the IntegratedTests workspace 
You can choose the zip format or access from SVN directly:

 The "swxbatch_ceefit" workspace is an extension of the "swxbatch" workspace. The main difference is the ability to load SolidWorks and using API and CEEFIT, pass it input from the CEEFIT tables and verify expected output as mentioned in the CEEFIT tables.

The solution is documented - but its my contention that nothing is ever documented enough - so if you need more information on how things work then leave a comment. I will put up another post that has more details.

  • You have SolidWorks installed and are working with appropriate licenses
  • You may need to have the SolidWorks API SDK installed to write SolidWorks API-based code.
  • You have access to Visual Studio (at least 2005, as this solution is provided in that version). Later versions should work but I have not tested them out.
Wish list of sub-goals
  • Passing in only HTML file (with CEEFIT tables) at a time is supported. This is how CEEFIT works by default, but it is not easy to test CAD stuff with all data in one single table. I wish for a solution to this and will post if I am successful. But for now it works as intended.
  • Currently integration of CEEFIT-based solutions with Continuous Integration systems (e.g. CruiseControl.NET) is poor, as CEEFIT only puts out HTML files and at least CruiseControl.NET does not merge HTML output as part of its build log, which is a bummer as "true" integration would help us identify a failure, location and cause, which this current framework does not do. I wish to write out the output of CEEFIT as XML (at least) so that it can be integrated into build systems. (To be honest, FIT and thereby CEEFIT profess to be tools that enhances customer interaction with systems in development, so HTML works best, but for developers HTML is difficult to incorporate into their workflow).
  • The provided workspace is good only for SolidWorks. I wish for a solution that allows interaction with various CAD systems, through their individual API, and tests my plugin application with all of them.
Notes and Tips:
  • The workspace, when run, starts SolidWorks in background (aka batch mode) by using a SolidWorks API, which simply hides the SolidWorks window.

  • If you want to make SolidWorks visible during its batch operations, then change the FALSE to TRUE and rerun. SolidWorks starts up and you can see all API actions play out like a movie. I should say it is almost as fun to watch as a video on Youtube.
  • I have used a global variable "swApp" as I don't know how else to pass variables in to the CEEFIT run test classes. While not a big problem, I hate global variables as they make testing otherwise hard to do.
  • Please visit the home page for this and other projects: for more information. I will try to update those pages soon and as regularly as possible.
  • For more information on CEEFIT you can read the short summary I have at or even visit the CEEFIT homepage at I should warn though that CEEFIT has not been updated for many years, but it works relatively well in its current stage. Hopefully enough of us use it to get the original author to continue development.
If you have downloaded "" to develop SolidWorks plugin applications (or Addins) then I sure that this workspace will be very useful to you. Let me know if you do or don't. Comments and suggestions are most welcome and will be responded to, so feel free to communicate your needs.

No comments:

Post a Comment