This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Run all tests in a suite | ||
---|---|---|---|
Product: | apisupport | Reporter: | Jaroslav Tulach <jtulach> |
Component: | Harness | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | jskrivanek, junit-issues, tboudreau, tomwheeler |
Priority: | P2 | Keywords: | PLAN |
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
based on 200709060000 daily build harness
based on 200709060000 daily build harness Recast as a source patch First stab at adding item to context menu (not yet tested) |
Description
Jaroslav Tulach
2005-12-29 16:31:08 UTC
I would like to have this too. I have an experimental version of this done, will try finalize it and attach a patch. Should be pretty easy, I guess. Created attachment 48342 [details]
based on 200709060000 daily build harness
Created attachment 48343 [details]
based on 200709060000 daily build harness
The attached files make it possible to run tests on modules within a suite, taking care not to run tests where none would be defined (i.e. any module which does not have a unit test directory). Sorry that I didn't include diffs; I did not see where common.xml comes from in CVS, but these are very small changes based on the build harness distributed with today's daily build. Created attachment 48347 [details]
Recast as a source patch
Would also need apisupport/project changes to expose the Test action on the suite. Well past feature freeze for 6.0, unfortunately. Thanks for turning it into a patch. Maybe it can go into some post 6.0 release. Even though there is no UI support in the IDE, you can still run it from Ant. The "JUnit Test Results" window will show the status of all tests from all modules in the suite. If you can give me a hint as to where UI support for running the tests from the suite should go, I might be able to do that too. apisupport/project/src/org/netbeans/modules/apisupport/project/ui/SuiteActions.java (compare to ModuleActions) Created attachment 48528 [details]
First stab at adding item to context menu (not yet tested)
I tested the patches tonight and they're working fine for me. The "test" menu item on the context menu for the suite is bound to the shortcut Alt+F6 (on amd64 Linux anyway). I didn't intentionally set that, but maybe that's how it's supposed to be. Otherwise, it worked perfectly, as described below. I applied both patches to a local copy of the trunk and built the IDE. I created a new suite, then added a source module to that suite. I added a simple class and corresponding unit test to the module, ran the new suite-level test target and it ran the expected tests. I added a library module to the suite, ran the test target again and it worked fine (i.e. it did not try to run non-existent tests in the library module). Finally, I added another source module to the suite, again with a simple class and corresponding unit test. The suite-level test menu item executed unit tests in both modules. Well remind me after 6.0 has been branched. I cannot commit anything at the moment, unfortunately - trunk is for 6.0 yet only bug fixes are accepted; there is no place to commit post-6.0 enhancements. Will do IMHO it's no enhancement but defect. Everyone, who writes tests, wants to run tests for all modules in suite. I'm for to create from this enhancement defect. Sorry, no. It may be a very desirable and natural feature to add, but the current design of suite projects intentionally does not include it, nor does the UI spec request it. Adding Tim to cc list and adding status whiteboard string to group issues we discussed/worked on last week. You asked for a reminder about this after 6.0 had been branched. Applied (#9fb9f1dd4a3d) with changes: 1. Need to sort by test dependencies, not just regular module dependencies. 2. Context menu item name changed to "Test All" for consistency with "Build All" etc. 3. Using ActionProvider.TEST constant. 4. Enabling action only for suites using 6.1+ harness. |