Home Corporate Contacts

TETware Knowledgebase


Products
Solutions

Information

Datasheet
Documentation
FAQ
Knowledgebase

Return to Knowledgebase Index

19. How to handle POSIX signals in a C language test case

This information is not applicable to Win32 systems.

 

Question

I'm using the C API to port some legacy test code to TET. The code issues a signal 14 (SIGALRM) during normal execution and this is trapped by the TCM, terminating the test prematurely.

I've tried setting TET_SIG_IGN=14 and TET_SIG_LEAVE=14 in the execute mode configuration but the TCM tells me this is an illegal entry. Are there any workarounds?

 

Answer

SIGALRM is a standard signal; that is: a signal whose behaviour is defined by POSIX. The TCM does not permit the handling of standard signals to be altered by the configuration variables that you mention because the way that such signals are to be handled is considered to be a matter for the test suite author rather than for the user.

If you want to change the TCM's default signal handling in a particular test purpose function, you can add code to change the signal's disposition in the function itself. This is the preferred solution - it enables each test purpose function to be self-contained and not rely on the execution (or non-execution) of a previous test purpose function.

Alternatively you can change the signal's disposition in the test case startup function, then set the API's global variable tet_nosigreset to a non-zero value in the startup function. When you do this, the TCM does not reset the dispositions of signals before it calls each test purpose function and so these dispositions remain unchanged (by the TCM, at least) throughout the life of the test case.

 

See also

  • The descriptions of tet_nosigreset, TET_SIG_IGNORE and TET_SIG_LEAVE in Chapter 8 of the TETware Programmers Guide.

  • "The Test Case Manager'' in the TETware Programmers Guide.


 


Home Contacts Legal Copyright Corporate News

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