Configuring TestDriver using command-line options

Configuring TestDriver using the config command involves setting up your environment and defining the following information:

  • The EPOC drive, the drive where the EPOC32 tree has been installed.

  • The XML root, the root path to your XML tree that defines your test hierarchy.

  • The repository location, the root path where all binaries and related test files are stored.

  • The result location, the root path where the test logs are stored.

  • The source root location, the root path where the source code is stored.

You can view or modify these settings using appropriate option of config command. When you type testdriver config in the command line, the current configuration is displayed.

To configure TestDriver using Carbide, refer to Configuring using Carbide

The following settings are made to configure the TestDriver using the config command.

Setting the epoc drive

To set the EPOC drive, use the command:

> testdriver config -e <path to EPOC drive>

For example, testdriver config -e h:\ sets the EPOC drive to h:\.

Setting the root path to XML structure

To set the root path to your XML structure, use the command:

> testdriver config -x <path to XML root>

For example, testdriver config -x h:\development\personal\CompVisitor\XML sets the root path to the XML structure.

Setting the root path to repository

To set the root path to the repository:

> testdriver config --repos <path>

For example:

> testdriver config --repos d:\repos

Setting the root path to test results

To set the root path to the test results, use the following command:

> testdriver config -c <path to result location>

This is used to set the root path for the test results and test logs.

Setting the root path to source code

To set the root path to the source code, use the following command:

> testdriver config --source <path to source>

TestDriver enables you to set more than one option using the config command. For example, all the settings mention earlier can be done in a single command:

> testdriver config -e h:\ --repos d:\repos -c d:\results --source p:\group\testsrc -x h:\dev\personal\CompVisitor\XML

After configuring TestDriver, you can start using it. For more options, see config.

Setting entry point address field

To tell the TestDriver the task it has to run, set the entry point address field, this is the task that TestDriver has to run. This value is set using -s option in the build, config, run or package commands.

You can set the entry point field in the following ways:

  • By specifying the default XML root directory, for example:

    > testdriver run -s taskA.taskB.taskC

  • By specifying the full URL of the location of the task in the driver file separated by a #. For example:

    > testdriver run -s file:/c:/adir/aseconddir/adriverfile.driver#taskA.taskB.taskC

Note: You can completely configure the TestDriver, this includes setting the entry point address, setting for build and so on using 'testdriver config' command and directly run the tests using 'testdriver run' command.

Configuring the plug-ins

TestDriver enables you to configure the plug-ins that are installed with it. These plug-ins are installed with default settings, which can be customised later.

You can change the default settings using the config command. The following is the syntax of the config command:

> testdriver config --plugin <plugin_name>:<variable_name>=<value>

For example, the following command sets the portNum variable of the reflash plug-in to 3:

> testdriver config --plugin com.symbian.driver.plugins.romflash:portNum=3

Configuring logging information

TestDriver uses the logging.properties file to configure the logging information where you can set the default values for logging levels, handlers and formatters for a log message.

An example for the logging.properties file would be:

# Specify the handlers to create in the root logger
    # (all loggers are children of the root logger)
    # Create two handlers
    handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
    
    # Set the default logging level for the root logger
    .level = ALL
    
    # Set the default logging level for new ConsoleHandler instances
    java.util.logging.ConsoleHandler.level = INFO
    
    # Set the default logging level for new FileHandler instances
    java.util.logging.FileHandler.level = ALL
    
    # Set the default formatter for new ConsoleHandler instances
    java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
    
    # Set the default logging level for the logger named com.symbian
    com.symbian.level = ALL

Configuring the logging information involves setting up the following in the logging.properties file:

Logging levels

A logging level can be used to control the logging output. A log message can be differentiated by it's level that can be configured by editing the line containing .LEVEL = INFO in the logging.properties file.

The supported logging levels in descending order are:

  • SEVERE (highest value)

  • WARNING

  • INFO

  • FINE

  • FINER

  • FINEST (lowest value)

Enabling logging at a given level also enables logging at all higher levels. For example, when you set .LEVEL = INFO for a message, logging at SEVERE and WARNING levels is also enabled.

Logging handlers

Handlers enable you to output logs to different locations such as a console, a file, a stream, memory, or a TCP socket on a remote host. Multiple handlers are used to output to each of these locations (for example, print all log messages to a file or to the console). Handlers include standard Java Handlers, including FileHandler, ConsoleHandler, MemoryHandler, StreamHandler and SocketHandler. However, Symbian also provides two custom handlers, EmailHandler and NetSendHandler that enable you to output logging messages to an email address and NetSend location respectively.

You can configure the log message to a handler using the logging.properties file:

handlername.handlerproperties = propertiesvalue

For example:

java.util.logging.FileHandler.pattern = TestDriver%g_%u.log

This sets up the FileHandler to use the pattern TestDriver&g_%u.log while naming the log files.

Example for handlers

In the following example:

com.symbian.et.utils.log.EmailHandler 
com.symbian.et.utils.log.NetSendHandler

The EmailHandler enables you to email the log messages to an email client and the NetSendHandler enables you to NetSend the log messages.

Example of the possible properties configurations for these handlers are as follows:

com.symbian.et.utils.log.NetSendHandler.numbererrors = 10

This sets the maximum number of errors that can occur before sending an email.

com.symbian.et.utils.log.NetSendHandler.sendlevel = WARNING 

This sets the meaning of the error.

com.symbian.et.utils.log.NetSendHandler.ip = 102.125.0.2

This sets the IP address to send the net-send message.

com.symbian.et.utils.log.EmailHandler.numbererrors = 5

This sets the maximum number of errors that can occur before sending an email.

com.symbian.et.utils.log.EmailHandler.sendlevel = WARNING

This sets the meaning of the error.

com.symbian.et.utils.log.EmailHandler.fromaddress = a.b@c.com

The address from where the log messages have to be sent.

com.symbian.et.utils.log.EmailHandler.toaddress = a.b@c.com

The address to send the log messages.

com.symbian.et.utils.log.EmailHandler.server = a.smtp@b.com

The SMTP server to send the log messages.

Output Formatters

Log messages can be sent to locations stated in the Logging Handlers section, as either in a simple text or in an XML format. Output formatters enable you to organise your output. Java includes the standard formatters, SimpleFormatter and XMLFormatter. Additionally, Symbian provides com.symbian.et.utils.log.SimpleFormatter, a simpler formatter to format your output.

More information on configuring the properties file to set the logging levels, handlers and formatters can be found in Configuring the logging properties and Logging messages.