Functional tests include SQL scripts and shell scripts that execute the SQL scripts and determine the results. The shell scripts build test tables in a database, run the SQL test scripts, and then drop the test tables from the database.
You can create custom shell scripts to run additional tests or initialization scripts. The generated scripts include calls to your custom scripts.
Shell scripts execute SQL scripts using DB-Access. The results from the SQL statements are saved in .log files. When you first run functional tests, you must inspect the .log files and, if the results are correct, use the shell scripts to copy them to .req files.
When you execute functional tests after saving .req files, the shell script uses the UNIX diff command to compare the .log files to the .req files. The script prints the following messages:
The functional test directory, functest, includes the following subdirectories:
The functest directory contains a master shell script, main.sh, for executing all of the functional tests generated for the DataBlade module. Each subdirectory in the udr, opaque, and cast directories also contains a main.sh script to execute only the functional tests in that subdirectory.
The subdirectories in the udr, opaque, and cast directories contain various SQL scripts. Each subdirectory has a setup.sql script and a cleanup.sql script. The setup.sql script creates test tables and initializes them with test data. The cleanup.sql script drops all of the test tables from the database.
BladeSmith creates the following SQL test scripts for the object being tested:
Script Names | Support Routines Tested |
---|---|
textio_pos.sql | Text input/output functions for an opaque type; uses only valid test data. |
textio_neg.sql | Text input/output functions for an opaque type; uses test data with invalid input data. |
binio.sql | Binary file input/output functions; uses the valid input data for the opaque type. |
textexp.sql | Text file import/export functions for opaque types; uses the UNLOAD and LOAD SQL statements. |
binexp.sql | Binary file import/export functions for an opaque type; uses nested calls to the binary file import/export functions. The result of the nested calls should be equivalent to the text input format for the type. |
notify.sql | The Assign/Destroy routines; inserts and deletes values in a new test table. |
compare.sql | The Compare function for an opaque type. |
equal.sql | The Equal function for an opaque type. |
notequal.sql | The NotEqual function for an opaque type. |
btree.sql
lessthan.sql lessthanorequal.sql greaterthan.sql greaterthanorequal.sql |
B-tree support functions for an opaque type. |
plus.sql
minus.sql times.sql divide.sql |
Standard math operators for an opaque type. |
positive.sql
negative.sql |
The Positive and Negate functions for an opaque type. |
concat.sql | The concatenation operator; calls the Concat function for an opaque data type with two instances of the type. |
hash.sql | The Hash support function with a SELECT...GROUP BY SQL query. |
A script is generated only when the support routines it tests are defined.
You can add other tests or initialization scripts to your test suite by adding your own scripts in the subdirectories of the functest directory and editing the sample user.sh shell script that BladeSmith generates. For example, you can add SQL scripts to create a test database, create special test tables in it, and execute custom tests against those tables.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]