Test scripts for MSSQL modules

This text gives some information on the test suits for MSSQL::DBlib and MSSQL::Sqllib. The exact behaviour of the scripts may depend on your SQL Server version, your regional settings and a few more things. Thus you may see failures, where I don't. This text attempts to indicate what could happen.

Running the test scripts

If you have installed the modules from sources, the simplest way to run the test scripts is with MAKE test. If you have made a binary install run the scripts from the command line. With the top directory for the Perl installation as the current directory run them as:

   perl dblib/t/1_dblib.t

Before you can run the scripts, you may need to edit the files DBlib/t/sqllogin.pl and Sqllib/t/sqllogin.pl to specify username, password and server. As shipped, they will attempt to log in with Windows Authentication on the local server. Don't forget to delete sensitive information from the files, when you have completed testing!

All test scripts run in tempdb, and do only create temporary tables and procedures.

Tests for MSSQL::DBlib

1_dblib.t tests basic DBlib functions: logging in, getting a result set, using a message handler, using RPC routines. Somewhat pessimistic in nature, it aborts on the first error that occurs.

If you run it directly from the command line, you will see one error message; this is natural as we are testing the error handler.

2_bcp.t tests BCP routines. This script requires MSSQL::Sqllib to run.

3_text.t tests the text/image functions. The last part of the script attempts to test dbprepupdaetext but since I never managed to get this to work, the script exits before that part is reached.

Tests for MSSQL::Sqllib

All these tests do of course require that MSSQL::DBlib is present, as MSSQL::Sqllib is an heir of MSSQL::DBlib.

1_resultsets.t tests the various row and result styles. If you are bewildered by resulting structure of the various combinations of row and result styles, you might get an idea by studying this script.

2_sptest.t tests sql_sp and sql_insert. The script also tests all SQL Server 6.5 datatypes. This script is sensitive to your configuration and may fail when testing date values if your regional settings are such that "Apr" is not understood as a month. The tests for real and decimal numbers may fail with rounding errors.

3_conversion_t will be skipped if your OEM charset is not CP850 or CP437. It assumes that the default character set of your server is Latin-1. If it is not, it is likely that several tests will fail.

4_errors.t tests the error handling. Test 17 fails with Perl 5.004, due to some advanced meddling wih STDERR. This script leaves a couple of files around in the sqllib/t directory.

5_uniqueid.t tests use of the SQL Server 7 datatype uniqueidentifier. This test is skipped if your server is running 6.5.


Last updated 03-01-01 20:14