Difference between revisions of "Setting up TUnit"

From TinyOS Wiki
Jump to: navigation, search
(Minimum Requirements)
(Minimum Requirements)
Line 6: Line 6:
 
* Check out a copy of the latest [http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x-contrib/ tinyos-2.x-contrib] repository (instructions [http://sourceforge.net/cvs/?group_id=28656 here]).
 
* Check out a copy of the latest [http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x-contrib/ tinyos-2.x-contrib] repository (instructions [http://sourceforge.net/cvs/?group_id=28656 here]).
 
* [http://ant.apache.org/ Ant] is completely '''optional''', but may be used to generate [http://www.lavalampmotemasters.com/reports/html/index.html nicer looking HTML reports].
 
* [http://ant.apache.org/ Ant] is completely '''optional''', but may be used to generate [http://www.lavalampmotemasters.com/reports/html/index.html nicer looking HTML reports].
 +
  
 
=== Simplistic Directory Structure ===
 
=== Simplistic Directory Structure ===

Revision as of 10:07, 10 January 2008

Minimum Requirements

The minimum requirements are:


Simplistic Directory Structure

Your projects and directories may differ. On the automated unit testing server, the tinyos-2.x and tinyos-2.x-contrib directories are located in a simplistic structure:

 opt
 |-- tinyos-2.x
 |-- tinyos-2.x-contrib

Complex Directory Structure

In my own private projects, I prefer a more complex structure:

 opt
 |-- myProject
 |   |-- tinyos-2.x    <-- A snapshot of TinyOS my project is compatible with
 |   |-- tests
 |   |   |-- ... bunch of sub-test directories...
 |   |-- tinyos-2.x-myProject    <-- Project's files that override the TinyOS baseline
 |   
 |-- tinyos-2.x-contrib


For the remainder of this setup guide, I will assume your TinyOS is setup in the simplistic structure, with directories located at /opt/tinyos-2.x and /opt/tinyos-2.x-contrib.

Environment Variables

TOSCONTRIB

TUnit needs to know where the tinyos-2.x-contrib is located so it may find the tinyos-2.x-contrib/tunit directory. Because TUnit is driven by a Java application, the TOSCONTRIB path must be absolute so Java can locate the directory.

 Linux
   export TOSCONTRIB=/opt/tinyos-2.x-contrib
 Windows/Cygwin
   export TOSCONTRIB="`cygpath -w /opt/tinyos-2.x-contrib`"


CLASSPATH

Your classpath must be updated to include tunit.jar and all of its dependencies.

 Linux
   export LOG4J=$TOSCONTRIB/tunit/support/sdk/tunit/depends/log4j.jar
   export TUNIT=$TOSCONTRIB/tunit/support/sdk/tunit/tunit.jar
   export XERCES=$TOSCONTRIB/tunit/support/sdk/tunit/depends/xerces.jar
   export JFREECHART=$TOSCONTRIB/tunit/support/sdk/tunit/depends/jfreechart-1.0.5.jar
   export JCOMMON=$TOSCONTRIB/tunit/support/sdk/tunit/depends/jcommon-1.0.9.jar
 
   export CLASSPATH="${CLASSPATH}:${LOG4J}:${TUNIT}:${XERCES}:${JFREECHART}:${JCOMMON}:."


 Windows/Cygwin
   export LOG4J="`cygpath -w $TOSCONTRIB/tunit/support/sdk/tunit/depends/log4j.jar`"
   export TUNIT="`cygpath -w $TOSCONTRIB/tunit/support/sdk/tunit/tunit.jar`"
   export XERCES="`cygpath -w $TOSCONTRIB/tunit/support/sdk/tunit/depends/xerces.jar`"
   export JFREECHART="`cygpath -w $TOSCONTRIB/tunit/support/sdk/tunit/depends/jfreechart-1.0.5.jar`"
   export JCOMMON="`cygpath -w $TOSCONTRIB/tunit/support/sdk/tunit/depends/jcommon-1.0.9.jar`"
 
   export CLASSPATH="${CLASSPATH};${LOG4J};${TUNIT};${XERCES};${JFREECHART};${JCOMMON};."

XML Setup Files