Question

I'd like to set up my projects in Eclipse to run FlexUnit tests everytime I save my work.

I found an example with JUnit here : http://misko.hevery.com/2009/05/07/configure-your-ide-to-run-your-tests-automatically/

How would you do it? Is it possible to run FlexUnit tests without Flash Player?

Was it helpful?

Solution

Yes, you could create a setup much like the one Misko describes using FlexUnit4. The key is creating an ANT build script that compiles your test runner and then invokes the FlexUnit ANT task on the resulting SWF.

Once you have the ANT build script setup you can jump right into step 4, as outlined in the article.

Getting the ANT build script setup correctly can be a little tricky if you're not familiar with ANT. I found the continuous integration (CI) sample project provided by the FlexUnit4 team to be a great reference. As of this writing, it's available here:

http://opensource.adobe.com/svn/opensource/flexunit/branches/4.x/FlexUnit4SampleCIProject/

OTHER TIPS

Try using Flex Builder 4 beta, it has unit testing integration built in.

Are you using the FlexUnit plugin for Eclipse? I don't know it, but it should execute FlexUnit tests.

If you want to execute something after you saved, you could use the Save Actions in Eclipse. They are inserted in org.eclipse.jdt.ui.cleanUps (according to a mailing list post).

Oh, I recently found this blog entry: FlexUnit + Ant. It seems like it covers your problem!

Good luck with that!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top