LSB Desktop T2C Readme

From ISP_RAS

Jump to: navigation, search

Contents

About

The package "lsb-test-desktop-t2c" contains test suites for the following libraries:

  • glib;
  • gmodule;
  • fontconfig;
  • atk (not at-spi!).

Prerequisites

The following components are required to build and run the tests:

  1. LSB 3.1 Software Development Kit (SDK). It can be found here. Also /lib/ld-lsb.so.3 should be found in your system after installation. If it is not, you should create a symbolic link with a command ln -s /lib/ld-linux.so.2 /lib/ld-lsb.so.3
  2. GNU C/C++ Compiler 3.4.6 or later.
  3. TET 3 Lite (Test Environment Toolkit, http://tetworks.opengroup.org/tet/). If TET root directory is not /opt/lsb-tet3-lite, this directory should be specified in the TET_ROOT environment variable.
  4. pkg-config
  5. libtool

Package Structure

Main suite directory is "desktop-t2c". It contains the following files and directories:

  • README - This file.
  • LICENSE - License information.
  • run_tests.sh - This script runs the tests.
  • fontconfig-t2c/ - Tests for Fonconfig library.
  • glib-t2c/ - Tests for Glib library.
  • gmodule-t2c/ - Tests for GModule library.
  • atk-t2c/ - Tests for ATK library.
  • locale/ - Custom locales required by the tests.
  • tetexec.cfg - Test execution parameters for TET.
  • tet_code - Definition of a "TIME EXPIRED" TET result code.


There are also the following files and subdirs in the main suite directory in the binary distribution:

  • tet_scen - main TET scenario file.


In the binary distribution the "*-t2c" directories contain the following:

  • scenarios/ - TET scenario files;
  • tests/ - the executables of the tests;
  • testdata/ (if present) - data used for testing;
  • reqs/ - requirement catalogue.


There are also the following files and dirs in the source distribution:

  • t2c_framework/ - tools from the T2C Framework required to prepare and build the tests. t2c/ subdirectory (stands for "Template-to-C", "Template-to-Code") contains the test code generator. It is used to generate TET-compliant tests in C as well as the makefiles and TET scenarios from the tests in special format (t2c-files). t2c/src/ and t2c/include subdirectories contain T2C source code and include files for the generated C files, respectively.
  • desktop-t2c/
    • build_all.sh - This script is used to build the tests from source.
    • gen_code.sh - This script is used to generate the C code of the tests but it does not build them.
    • clean_all.sh - This script removes all executables, generated C files, object files, and temporaries from desktop-t2c and its subdirs.

In the source distribution the "*-t2c" directories contain the following:

  • a config file (*.cfg) for the T2C code generator;
  • gen_tests - test generation script;
  • clean - clean up script;
  • src/ - sources of the tests (in T2C format) for the respective library.
  • include/ (if present) - header files for the tests;
  • reqs/ - requirement catalogue;
  • testdata/ (if present) - data used for testing (along with the sources and makefiles if the data needs to be built).


Building the Test Suite from Source

1. Unpack the source tarball to some directory, say, /tmp/tests. Change current directory to /tmp/tests/lsb-test-desktop-t2c-X.Y (X.Y is a version number).

2. Build T2C code generator first by executing t2c_framework/t2c/build.sh. Then set T2C_ROOT environment variable so that it contained the path to the main directory of the T2C Framework:

   export T2C_ROOT=/tmp/tests/lsb-test-desktop-t2c-X.Y/t2c_framework/ 

This variable will be used during the build process of the tests.

3. Change current directory to desktop-t2c and execute the "build_all.sh" script to prepare and build the tests:

   cd /tmp/tests/lsb-test-desktop-t2c-X.Y/desktop-t2c
   ./build_all.sh

During the build, the T2C code generator is invoked to create C code from t2c files. Generated C-files can be found in subdirectories of "*-t2c/tests/" ("*" stands for "fontconfig", "glib" etc.).

These C sources are then compiled and linked using the makefiles that are generated by T2C too.The TET scenario file (tet_scen) is placed to the main suite directory ("desktop-t2c").

4. You also need to install a custom locale used by the tests. To do this, run the following command from the "desktop-t2c" directory (this may require root privileges):

   localedef -c -f UTF-8 -i ./locale/POSIX_test_dec.ldf en_POSIX_test_dec

Running the Tests

To run all the tests, execute the "run_tests.sh" script from the directory where you have the desktop-t2c suite installed (usually /opt/lsb/test/desktop-t2c) directory.

The tests should be run as an "ordinary" user rather than root. Some of these may fail if executed with root privileges.

If you want to run the tests from a particular suite (glib-t2c, fontconfig-t2c etc.), specify the name of this suite as a parameter for run_tests.sh.

Example:

   ./run_tests.sh fontconfig-t2c

Viewing the Test Results

The test results (journals) can be found in the TET journal - desktop-t2c/results/XXXXe/journal, where XXXX is a number. The latest results correspond to the highest XXXX number.

You can use the "vres" script included in TET contrib distribution to display a summary of the results.

Example:

   $TET_ROOT/contrib/usltools/vres  desktop-t2c/results/0001e/journal

Building Packages

Here are the instructions for building source and binary packages for the "Desktop-t2c" test suite.

Prerequisites

  • bzr, 0.13 or newer
  • build tools: make, lsbcc
  • lsb dynamic linker is in proper place (/%_lib/ld-lsb-%_arch.so.3)
  • rpmbuild
  • alien and fakeroot to generate DEB from RPM.

Checkout and build should be performed by an "ordinary" user, rather than root.

Checkout the branches for the T2C Framework and the test suite from Bazaar-NG

An initial checkout of the branch may take some minutes to complete:

   $> bzr branch http://bzr.linux-foundation.org/lsb/devel/t2c-harness 
   $> bzr branch http://bzr.linux-foundation.org/lsb/devel/t2c-desktop-tests 

or if you have existing branches, say, in /home/tester/temp: $> cd /home/tester/temp/t2c-harness $> bzr pull $> cd ../t2c-desktop-tests $> bzr pull

Building the tarball and package

To build both tarball and package execute the following commands. The Makefile accepts the environment variable BZRTREES to use the sources from your local branches to build the tarball, rather than the remote ones.

   $> cd desktop-t2c/package
   $> BZRTREES=/home/tester/temp make

You should find something like this at the end of the build:

   lsb-test-desktop-t2c-<version>.src.tgz
   lsb-test-desktop-t2c-<version>-<revision>.src.rpm
   lsb-test-desktop-t2c-<version>-<revision>.i486.rpm

You could also build source tarball and binary packages in two separate steps:

Build source tarball

   $> cd desktop-t2c/package
   $> BZRTREES=/home/tester/temp make tarball

Build rpm package

   $> make rpm_package

Bug Reporting

If you have found a bug, please send us an e-mail to <linux@ispras.ru>.



Copyright (C) 2007 The Linux Foundation.
The T2C system and the tests were developed by ISPRAS for The Linux Foundation.

Personal tools