Introduction ------------ PhpTET is a PHP-CLI implementation of the TET API. The implementation has been done using the interface compiler SWIG (http://www.swig.org). PhpTET was developed on a RedHat 9.0 Linux using TETware release 3.7, but there is no reason it shouldn't work on any POSIX conforming platform that supports PHP and one of TET 3.3, TET3.6 or TETware 3.7. This implementation is known to work on PHP-CLI versions 4.3.8 and 5.0.1. Building -------- It is assumed you have first installed and successfully built one of the TET versions mentioned above. You should have an environment with TET_ROOT set and a PATH with $TET_ROOT/bin and the location to the PHP interpreter. You can edit and source in the provided phptet_profile. PHPRC must contain the directory where the php.ini file is located. A sample php.ini is provided which needs editing for you system. It contains the parameters include_path for the search path for the phptet modules (phptet.php, phptet_dyn.php) and extension_dir for the location of the phptet dynamically loadable library (php_tet.so). You will need to edit the Makefile and check the settings for the target system. You can then run the make command to build the shared library. If you want to re-run SWIG you will need to have SWIG 1.3.21 or later installed on the system. You can then compile using Makefile.swig after checking the contents. Running the demo ---------------- A PhpTET demo is supplied under phptet_demo. This contains a tet_scen with three sample test sets; tc1, tc1 and tc3. Have a look at the contents of each test set. This will give you an idea of how to make calls to the TET API through PHP. The main points to remember is to first include the phptet.php module in the test code using the "include" directive. Then the optional startup and cleanup functions are defined followed by the list of test functions. References to the test functions are stored in an associative array called $testlist. To register the all the PHP functions and start running the tests you will finally need to call phptet_init(). This method takes 3 arguments; the test list array, and optionally the names of the startup and cleanup functions. If the startup and cleanup functions are not provided, then just pass the constant value TET_NULLFP. To run the phptet_demo tests, you will need to check and source in the settings in phptet_profile, then change to the phptet_demo directory and run the command: tcc -p -e . This will run the tests and put the journal in the results directory. Hopefully this is enough to get you started! Regards, Neil Moses, The Open Group, 18th March 2005.