org.pyant.tasks
Class PythonCoverageTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.pyant.tasks.PythonBaseTask
              extended by org.pyant.tasks.PythonInteractiveBaseTask
                  extended by org.pyant.tasks.PythonTestTask
                      extended by org.pyant.tasks.PythonCoverageTask
All Implemented Interfaces:
Cloneable

public class PythonCoverageTask
extends PythonTestTask

Runs coverage.py and outputs a colorized visualisation of coverage.

Sample usage:

Where:

  1. pythonpath is PYTHONPATH, of course (optional)
  2. <tests> contains tests to run.

Author:
"Gregory Golberg"
See Also:
http://nedbatchelder.com/code/modules/coverage.html, http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/491274

Field Summary
protected  File coverage
          ` Location of coverage.py
protected  File reportsdir
           
 
Fields inherited from class org.pyant.tasks.PythonTestTask
dir, filesets, packagedtests, testrunner
 
Fields inherited from class org.pyant.tasks.PythonInteractiveBaseTask
script
 
Fields inherited from class org.pyant.tasks.PythonBaseTask
failonerror, optimize, python, pythonpath
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
PythonCoverageTask()
           
 
Method Summary
 void addSrc(org.apache.tools.ant.types.FileSet src)
           
 void addTests(org.apache.tools.ant.types.FileSet tests)
           
 void execute()
          Main entry point.
 void setCoverage(File coverage)
           
 void setReportsdir(File reportsDir)
           
 
Methods inherited from class org.pyant.tasks.PythonTestTask
addFileSet, getModulesArg, setDir, setPackagedtests, setTestRunner
 
Methods inherited from class org.pyant.tasks.PythonInteractiveBaseTask
addCommandlineArgs, createStreamHandler
 
Methods inherited from class org.pyant.tasks.PythonBaseTask
createCommandline, createExecute, execExecuteTask, executeScript, failureOcurred, fixFilePath, getCommandline, getPython, prepCommandline, setFailonerror, setOptimize, setOptimizeArgument, setPython, setPythonpath, setPythonPathInExecute, setPythonpathref
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

coverage

protected File coverage
` Location of coverage.py


reportsdir

protected File reportsdir
Constructor Detail

PythonCoverageTask

public PythonCoverageTask()
Method Detail

setCoverage

public void setCoverage(File coverage)
See Also:
coverage

addTests

public void addTests(org.apache.tools.ant.types.FileSet tests)
See Also:
tests

addSrc

public void addSrc(org.apache.tools.ant.types.FileSet src)

setReportsdir

public void setReportsdir(File reportsDir)

execute

public void execute()
Main entry point.

Overrides:
execute in class PythonTestTask
See Also:
Task.execute()


Copyright © 2010. All Rights Reserved.