Creating a TEF Block Project and Class

This section describes how to create a TEF Block project and a TEF Block class.

Introduction

The TEF Block is an extension of TEF that gives developers additional control over the workflow of tests. Test-case flow can be described in a script in an object-oriented way.

  • A TEF Block project is used to test header files of other projects. A TEF Block project can be created as a test environment using PCW. It is an environment suitable for developing and running your test programs. The project also hosts TEF Block classes and other generated files.

  • A TEF Block class is used to test classes in the current project.

Creating a new TEF Block project

This section describes how to create a new TEF Block project using the Project Creation Wizard.

  1. Click File > New > New Project to launch the Project Creation Wizard.

    The Project Creation Wizard can also be launched by clicking File > New > Symbian OS C++ Project > TEF Block Project.

  2. Select TEF Block Project under Generic Symbian OS Tests to create a new TEF Block project and click Next.

    New project wizard


    New project wizard

  3. Type the Project name for the new project. Select a location for the new project or accept the default location, and click Next.

    If you select a location that does not exist, the wizard creates the directory automatically.

    Project name


    Project name

  4. Select one or more SDKs and Build Configurations to build the project for the specified platforms. Click Next.

    Enable the Filter SDKs based on selected template option to show only the build configurations based on the SDK template you previously selected. Uncheck this option to show all enabled SDKs and their related build configurations.

    Symbian OS SDKs


    Symbian OS SDKs

  5. Click Add Wrapper Class to add a new TEF block wrapper. Enter the class name.

    Note: Wrapper classes are not mandatory. If no wrapper class is needed, skip to the next step.

    Adding wrapper class


    Adding wrapper class

    Select a wrapper class, the Add Test Method button will be enabled. Click Add Test Method to add a new test method. Enter the method name.

    Adding test method


    Adding test method

    The default wrapper name for a class and a method is customisable. For information about customising the names, refer to SVS Test Suites Preference.

  6. Click Next to set project properties in the Basic Settings dialog box.

    The UID, Author name and Copyright fields can be set as follows:

    Basic settings


    Basic settings

    Note: For detailed information on all fields, please refer to Carbide Help > Carbide C++ User Guide > Create Projects.

  7. Click Next to launch the Project Directories dialog box. You can change the directories for the files to be generated or accept the default directories. Click Finish.

    Project directories


    Project directories

  8. The wizard creates a project that contains the following set of files:

    • .class

      Note: The generated TEFBlockBlockController is a subclass of CTestBlockController. The generated TEFBlockBlockServer is a subclass of CTestServer2. These classes include basic functions provided by SVS Test suites.

    • .script file

    • .mmp file

    • bld.inf file

    • .iby file

    • .ini file (if selected)

    The wizard also creates a folder structure as follows:

    Project generated


    Project generated

    Note: The class files generated can be customised. For information about customising the name and contents, refer to SVS Test Suites Preference.

Creating a TEF Block class

This section describes how to create a TEF Block class to an existing project.

In most cases, a TEF Block class is used to test classes in the current project. The current project is also called the hosting project. Besides the TEF Block class, other files such as .ini and .script files are generated as well. These files are saved separately in a test folder.

  1. In the project perspective of Carbide, right click the project to test, go to Index > Rebuild. Make sure there is no error after rebuild. This step ensures the Class Creation Wizard can find all of the classes in this project to test.

  2. Click File > New > New Symbian OS C++ Class to launch the Class Creation Wizard.

  3. Select the project where the TEF Block classes will be created and click Next.

    Existing projects


    Existing projects

  4. Select TEF Block Test Class to create a TEF Block class and click Next.

    TEF Block Test Class


    TEF Block Test Class

  5. Select the source project to test. By default, From Hosting Project is selected.

    Enter the Target Name at the bottom, for example Testmsgdebugger. The target name is used for the names of the files to be created for example Testmsgdebugger.driver.

    Selecting the hosting project


    Selecting the hosting project

    If From Hosting Project is selected, the current project will be tested.

    If From Header Files in \epoc32\include is selected, you can click the Add button to add header files of other projects. In this case, the current project is not the project to test, but only hosts the TEF Block.

    Selecting header files


    Selecting header files

  6. Click Next to select the classes or methods to test. Click Next.

    If From Hosting Project was selected in the previous step, all of the classes in the hosting project are listed here.

    Classes to test


    Classes to test

  7. If necessary, change the directories for the files generated by the wizard and click Next. By default, the generated files are saved under the test folder.

    Project directories


    Project directories

  8. Set the project properties in the Other Settings dialog box. Click Finish.

    The UID, Author name and Copyright fields can be set as follows:

    Other settings


    Other settings

    Note: For detailed information on every field, please refer to Carbide Help > Carbide C++ User Guide > Create Projects.

  9. A set of files for TEF Block are generated as follows:

    • .class

      Note: The generated TEFBlockBlockController is a subclass of CTestBlockController. The generated TEFBlockBlockServer is a subclass of CTestServer2. These classes include basic functions provided by SVS Test suites.

    • .script file

    • .mmp file

    • bld.inf file

    • .iby file

    • .ini file (if selected)

    Generated files for TEF Block are saved under the default test directory. Other files and directories of the existing project remain unchanged.

    Files generated


    Files generated

    Note: The name of the wrapper class and the name and contents of the controller and server files can be customised. For information about customising the name and contents, refer to SVS Test Suites Preference.