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 Perl 5.004 or later, including ActiveState Perl versions, the simplest way to run the test scripts is with MAKE test. If you only have ActiveState 3xx, you only have the option of running the files directly from the command line. With AS 3xx you must be in the directory where the test scripts reside, Dblib/t and Sqllib/t respectively.

Before you can run the scripts, you probably 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 as sa with no password 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. There are no known issues with this script, except that test 99 fails if you run without warnings. 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. It is not, it is likely that several tests will fail.

4_errors.t tests the error handling. There are no known issues with this script, save that it 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 or lower.


Last updated 01-05-05 19:11