SourceForge.net Logo
prevtopnext
izh_test
    Kinds of tests
        Adapted tests and test commands.
mysql - Executing of sql-queries with help of mysql.

The test command allows executing queries over MySQL database.

Full specification of the test looks like:
<mysql>
  <script>file path of sql-script</script>
  <query>text of sql-script</query>
  <etalon>output of mysql</etalon>
</mysql>
Where:
script

Name of file which will be sent to the standard input stream of mysql client.

The file should contain set of sql-commands.

Before using of this file name izh_test adds path to the directory with file description of the test to it so you don't have to use %test_dir% .

query

Text which will be sent to the standard input stream of mysql client.

The text should contain set of sql-commands.

This field is used only if field script (see previous definition) is empty.

Otherwise (field script contains name of file with data), izh_test will send content of file with name script but content of field query will be ignored.

etalon

Base file name for "test file result" which will be used to store result of sql-commands.

Usually this file name has an extension.

If the file name looks like [name].[last_extension] then

  • name of the result file will be [name].result.[last_extension],
  • name of the etalon file will be [name].etalon.[last_extension],
  • name of the file difference will be [name].diff.

Before using of these file names izh_test adds path to the directory with file description of the test to it so you don't have to use %test_dir% .

To use this command you have to initialize value of substitution variable %mysql% which should contain right path and file name for the console client mysql with all the parameters of connection.

It is easy to understand that the test command really is simple more short and convenient variant of command exec_check or exec (it depends on value of field etalon). Really:


prevtopnext

SourceForge.net Logo