Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Defining Command Line tests

A generic test harness called CommandLineTest is available, which enables any test harness to be executed as it would be from command line.

Below is an example of how to define that a command line test should be used, based on the commandLineTest.dtd:

<commandLineTest>
  <name>HelloWorld</name>

  <commandLine>c:\system\programs\helloworld.exe symbianuk.script -i</commandLine>

  <logFile>c:\HelloWorld\log.txt</logFile>

  <timeout>60</timeout>

  <copyFrom src="c:\testdriver\test.txt" dst="test.txt"/>

  <beforeTestRun cmd="C:\WINNT\notepad.exe"/>

  <afterTestRun cmd="c:\WINNT\notepad.exe"/>

  <dependencies>
    <data>
      <hostPath>epoc32\data\Test.data</hostPath>
      <devicePath>c:\HelloWorld\Test.data</devicePath>
    </data>

    <build type="test">
      <hostPath>cinidata.dll</hostPath>
      <devicePath>c:\system\libs\cinidata</devicePath>
      <bldInfPath>development\cinidata\group\bld.inf</bldInfPath>
      <mmpFile>cinidata.mmp</mmpFile>
    </build>

    <retrieve timeStamp="yes">
      <devicePath>c:\system\programs\HelloWorld\Retrieve.me</devicePath>
      <hostPath>c:\apps\HelloWorld\Retrieve.me</hostPath>
    </retrieve>

    <retrieve timeStamp="no">
      <devicePath>c:\system\programs\HelloWorld\Retrieve.me</devicePath>
      <hostPath>\HelloWorld\Retrieve.me</hostPath>
    </retrieve>

    <retrieve>
      <devicePath>c:\system\programs\HelloWorld\Retrieve.me</devicePath>
      <hostPath>HelloWorld\Retrieve.me</hostPath>
    </retrieve>

    <delete>
      <devicePath>c:\system\programs\HelloWorld\Delete.me</devicePath>
    </delete>
  </dependencies>

</commandLineTest>


CommandLineTest XML tags

The following XML tags are available to use.

XML tag

Description

<commandLine>

The full path of the executable or application to be started on the device.

<name>

This is the name of the application to be started.

<logFile>

This is optional and provides the path to the test log file to be retrieved, within the result repository of Test Driver.

<timeout>

This is the maximum amount of time, in seconds, for the test to run to completion. If the test runs for longer than the specified timeout period, the test will be killed and the next test is started automatically.

<copyFrom>

This tag is optional and can be used when performing remote testing and additional files are required as part of the test results. It allows you to specify a file to be copied from a source location (src) to a location in the results repository (dest).

The additional files become part of the results.zip file which is passed from the server to the client in TestMaster/TestClient environment (see XREF to Remote testing section).

<beforeTestRun>

This tag is optional and allows you to perform any pre-test processing on the server using an external program (not part of Test Driver) when executing a test remotely. This may be useful, for example, when wanting to make sure that the environment is clean before running the test.

The processing can take up to 5 mins - if it has not finished within this time period, an error message will be sent to the user.

<afterTestRun>

This tag is optional and allows you to perform any post-test processing, using an external program (not part of TestDriver) when executing tests remotely. This may be useful, for example, when wanting to send an email notification to the client after the test has been completed.

The processing can take up to 5 mins - if it has not finished within this time period, an error message will be sent to the user.

<dependencies>

This tag is used to describe any dependencies required for this test. Dependencies are optional, but when used they need to be defined as either data files or buildable files. The format used for each type is described below.

<data>

This tag is used to describe a data file dependency for the test, e.g. an existing file that does not need to be built. It contains two sub tags:

  • <hostPath> - defines the source location of the data file on the PC, after an export has been made.

  • <devicePath> - defines the target location of the data file on the device.

<build>

This tag is used to describe a buildable file dependency for the test. It has an attribute; "type" which specifies how the dependency should be built using the abld command.

This could be either of the following:

  • "normal", indicating that the dependency will be built as a non-test project, i.e. build this dependency without 'test' in the abld command. For example abld build ….

  • "ASSP" (Application-Specific Standard Product), indicating that the dependency will be built for a specific product, e.g. MISA for an Assabet or Lubbock board.

  • "Normal_ASSP", indicating that the dependency will be built as a non-test project specific to a product.

  • "test", indicating that the dependency will be built as a test project. For example "abld test build …".

  • Default is set to "test" as described above.

The <build> tag also contains several sub tags:

  • <hostPath> - defines the location of the binary file on the PC.

  • <devicePath> - defines the target location where the buildable file is to be found on the device.

  • <mmpFile> - defines the name of the project file, (.mmp) to be built.

  • <bldInfPath> - defines the location and name of the bld.inf file for the project to be built.

<retrieve>

This is a file dependency on the device side, created by the test. This file is deleted after the test has run on the device side, and retrieved to the PC host side. The tag contains two subtags:

  • <hostPath> - defines the source location of the data file on the PC, after the test has run. The format of the path can be absolute, begin with a backslash or any other relative tags.

    You can also specify your own path using the -c option when running the test using TestDriver, see Running test suites.

  • <devicePath> - defines the location of the data file on the device.

It also contains an additional attribute, timeStamp, which allows you to define whether the file should be saved on the host side with a pre-pended time stamp (yes" or "no").

<delete>

This is a file dependency on the device side, created by the test. This file is deleted after the test has run on the device side, but not retrieved on the host side. The tag contains one subtag:

  • <devicePath> - defines the location of the data file on the device.

[Top]


See also