Home Corporate Contacts

TETware Knowledgebase


Products
Solutions

Information

Datasheet
Documentation
FAQ
Knowledgebase

Return to Knowledgebase Index

4. How does tcc locate the build tool?

tcc locates the build tool by using the PATH environment variable in the normal way. When tcc processes a test case in build mode it first changes to the test case source directory. Then tcc executes the build tool exactly as specified by the TET_BUILD_TOOL variable in the build mode configuration file.

Sometimes a test suite is organised so that the tools are located in a bin directory below the test suite root directory. tcc does not search this location automatically so, if you want to organise your test suite in this way, you should include this directory in your PATH. Alternatively, you can specify the location of the build tool relative to the test case source directory.

For example, in the SHELL-API test suite that is part of the contrib distribution, the build tool is tet-root/contrib/SHELL-API/bin/buildtool and the test cases live in directories below tet-root/contrib/SHELL-API/ts. The build mode configuration file contains the line


TET_BUILD_TOOL=buildtool
and the test case setup script prepends tet-root/contrib/SHELL-API/bin to the PATH environment variable. Thus tcc is able to find the build tool by using PATH. The same result could have been achieved without the need to modify PATH by specifying the location of the build tool relative to each test case source directory, thus:

TET_BUILD_TOOL=../../bin/buildtool
(Note that when this is done it is necessary for all the test case source directories to be on the same level in the directory hierarchy.)

 

Distributed TETware

In Distributed TETware the build tool is located as described above on each system. On a remote system the value of PATH that is used is the one in tccd's environment on that system. On UNIX systems where tccd is started on demand from an entry in /etc/inetd.conf, the default value of PATH that tccd inherits from inetd is usually fairly minimal; for example: PATH=:/bin:/usr/bin. If necessary you can specify a different value of PATH by using the -e option to tccd. For example, on a SVR4 system where the compilation tools live in /usr/ccs/bin, you might put the following entry in /etc/inetd.conf:


tcc	stream	tcp	nowait	tet	 tet-root/bin/in.tccd \
	in.tccd -e PATH=:/usr/bin:/usr/ccs/bin

Win32 systems

On Windows NT the o/s defines an environment variable called Path and the MKS shell defines a variable called PATH.

The getenv() function in the Microsoft C runtime support library is case-insensitive, so when tcc locates the build tool, it is possible that either the value of PATH or Path may be used. Therefore, if you change the value of PATH from the MKS shell, you should be sure to change the value of Path as well.

If you use a Shell script build tool on a Win32 system, its name must have a .ksh suffix. Alternatively you can say:


TET_BUILD_TOOL=sh
TET_BUILD_FILE= mybuildtool
in the execute mode configuration file.

A shell script should not start with a #! line since the MKS shell tries to interpret this and probably won't do what you expect. In any event, using #! is always non-portable on Win32 systems since the location of files can vary from system to system.

 

Other tools

All the information in this article also applies to the prebuild tool, the build fail tool and the clean tool.

The exec tool is processed slightly differently by tcc in that it might be executed in the test case source directory, in a location below the alternate execution directory, or in a location below the temporary directory, depending on the settings of certain configuration and environment variables. Therefore it is best not specify a TET_EXEC_TOOL with a relative path name because when the execution directory is changed the tool will no longer be found.

 

See also

  • "Build mode processing'' and "Configuration variables which modify TETware's operation'' in the TETware Programmers Guide.

  • The tccd manual page in the TETware User Guide.

 


Home Contacts Legal Copyright Corporate News

Copyright © The Open Group 1995-2012, All Rights Reserved