ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference

MyASPN >> Reference >> >> >> >> >>
Komodo documentation

Unit Testing

Komodo has a unit testing interface for Perl, PHP, Ruby and Python. Unit tests can be defined globally, or within a project. Test output is displayed in the Test Results tab in the bottom pane. Click on an error to jump to the relevant file and line number.

Creating a Test Plan

To create a global test plan, click Tools|Test Plans|Create New Global Test Plan.... Global test plans can be edited and managed in Komodo's preferences.

To create a project-specific test plan, right-click on a project and select Create New Test Plan.... Project-specific test plans can be edited and managed in the project preferences.

In the "Define a new Test Plan" dialog box:

  1. Give the test plan a unique name
  2. Select the language
  3. Set the directory to run the test command in (usually the base directory of a project).
  4. Specify any additional command line options (see below).
  5. Click 'OK' to save the test plan

Supported Test Frameworks by Language

  • Perl: Uses 'make test'. If no Makefile is present, it first runs 'perl Makefile.PL' to generate one before running 'make test'.
  • Python: Uses the unittest framework. You need to specify a list of files and/or directories to test.
  • PHP: Uses the PHPUnit framework. Set the test plan to point to the base directory of the project. The test harness will look for a subdirectory called tests.
  • Ruby: Runs 'rake'. If the default action of the Rakefile is to run tests, no command-line options are needed. If not, enter the appropriate target for rake (e.g. 'rake test').

Running a Test Plan

To run a test plan, select it from the drop list in the Tests Results tab in the bottom pane and click the Run Test Plan button. The drop list shows all test plans available globally and in the current active project.

These plans can also be started from the Tools|Test menu.

Project-specific test plans can be run by right-clicking on the project to bring up the context menu, then selecting the test plan from the Test sub-menu.




Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved