Using the z/TPF test infrastructure
You can use the z/TPF test infrastructure with a new test application.
Procedure
-
Include the idevops environment variable in all of the makefiles that are
used in the test application.
The idevops environment variable sets up the necessary environment for the automated test. The following example updates the makefiles that contain the test cases.
APP := QXZY TPF_DRIVER := sock maketpf_env := drvs maketpf_env += idevops maketpf_env += base_rt CXX_SRC := qzz1.cpp include maketpf.rules -
Create a TPF_TESTSUITE entry in only one source
file of a C shared objects (CSOs).
In the following example, the TPF_TESTSUITE macro defines the following items:
- The ibm.education.tests namespace that the test cases in this CSOs are associated with.
- The ABCD and CT* programs that are used to measure the code coverage after the tests complete.
#include <tpf/c_devops.h> ... TPF_TESTSUITE("ibm.education.tests","ABCD,CT*")Note: The source file must include the tpf/c_devops.h header file. -
Provide a TPF_TESTCASE wrapper around each of the
test cases with meaningful test case names and descriptions.
In the following example, the TPF_TESTCASE macro identifies an individual test case so that the framework can find the test_overbook test case.
#include <tpf/c_devops.h> ... TPF_TESTCASE (test_overbook, "Try to book a reservation when no seats are available.") { …Test case logic }