File:  [NetBSD Developer Wiki] / wikisrc / tutorials / how_to_run_tet_framework.mdwn
Revision 1.2: download - view: text, annotated - select for diffs
Sun Feb 5 07:14:36 2012 UTC (2 years, 2 months ago) by schmonz
Branches: MAIN
CVS tags: HEAD


[[!toc levels=2]]

#  What TET is 

The TETware family of tools are Test Execution Management Systems that takes care of the administration, sequencing, reporting and portability of all of the tests that you develop. Freeing up developers to concentrate on test development and helping testers by providing them with a single, standard, test harness. Enabling you to deliver your software projects on time and across multiple operating systems. They are all available off-the-virtual-shelf. Easily accessed by ftp download. So stop re-inventing the wheel, take the drudge out of test development and use TETware. 

#  Reason of this article 

There is an artcile describes how to build and run TET framework from scratch. The pkgsrc version has several restrictions: 

  * the recent version not available until now 
  * necessary to have the pkgsrc infrastructure 
  * only distributed version of TET is provided 

However, you may apply patches from the pkgsrc tree (for example the patch-ad still can be applied for distributed TET). 

#  Porting to NetBSD 

Current opensourced version is 3.7a. To download or check new versions look to the Links section below. (The guide was tested at least on the NetBSD-current/i386 and NetBSD-current/ARMv6) 

#  Patchset 

[The simply patch](/images/TET-Configure.diff) would be applied before compilation is started. 

#  Prebuild 

  * After applying patch you'll need to copy the proper makefile 
    cp src/defines/UNTESTED/ src/defines/

  * Make the $TET_ROOT directory like _/opt/tet3_
  * Copy content of TET sources tree to $TET_ROOT 

**Notice to get distributed TET**: 

  * Create regular user _tet_ on the target system with home path as $TET_ROOT without real shell 

#  Build 

  * Change working directory to $TET_ROOT 
  * Build framework 
    ./configure -t <style>
    cd src
    make install

where <style> means Lite (_-t lite_) or Distributed (_-t inet_) version of TET framework. 

**Notice to get distributed TET**: 

  * Change owner of the $TET_ROOT to _tet_ recursively 

#  Update user's files 

  * Put to your ~/.profile 
    # TET
    export TET_ROOT="/opt/tet3"
    export PATH=$PATH:$TET_ROOT/bin

#  System files correction (distributed TET) 

  * Start tccd daemon from the /etc/rc.conf 
    export TET_ROOT="/opt/tet3"
    if test -x "$TET_ROOT/bin/tccd"
            $TET_ROOT/bin/tccd && echo "TET3 tccd started"

Other files (_$TET_ROOT/systems_, _$HOME/systems.equiv_, _/etc/services_) are corrected in according to TET3 install guide. 

##  Sample of required files 

You'll need a minimal _$TET_ROOT/systems_ file. The following content in the file is enough for this test suite. 
    000 localhost 60103

For the 'inet' version of TET, you'll need tccd running, and a _$HOME/systems.equiv_ file in the directory of the user running tccd. The following contents will do for this file: 

**Note!** In our case the _$HOME_ is equivalent to _/opt/tet3_

And you'll need to append following lines to the _/etc/services_: 
    tcc             60103/tcp
    tcc             60103/udp

#  Simple check 

The directory _contrib_ in the source tree contains a number of simplest examples of test cases. Let's start something from it step by step. Consider test cases under _contrib/capi_. Login as user _tet_. Be ensure you have set $TET_ROOT to actual path (_/opt/tet3_ in our case) and _$TET_ROOT/bin_ is covered by $PATH. 
    $ echo $TET_ROOT
    $ echo $PATH

Change current directory to _$TET_ROOT/contrib/capi_. 
    cd $TET_ROOT/contrib/capi

Patch test case build system (yeah, I know...): 
    --- tools/buildtool.c.orig      2008-11-24 13:15:58.000000000 +0000
    +++ tools/buildtool.c   2008-11-24 13:16:15.000000000 +0000
    @@ -51,7 +51,7 @@
     #define BUILDSUCCESS 0   /* successful return from buildtool */
    -static void tbuild()
    +void tbuild()
     char command_line[BUFLEN];
     char bres_line[BUFSIZ];

To run the test suite, firstly apply profile setting, then run the _Setup_ script and after use tcc. 
    source profile
    sh ./Setup
    tcc -p -bec contrib/capi

#  Links 

  * [Free TET Framework][15]
  * [Documentation][16]
  * [VSTHlite][17] - pthread test suite 

   [15]: (
   [16]: (
   [17]: /VSTHlite (VSTHlite)

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb