Information on how to setup and run the exOdbc tests.
The tests require a test database with tables containing all tested datatypes and a working DSN entry or a working connection string to connect to the test database. SQL scripts to create the required test tables and populate them with the expected test values are available. In the directory test/sql/, a subdirectory for every tested database system is provided with the corresponding SQL scripts to create the tables. For the following database systems create scripts are provided:
You can either run these scripts manually in your test database, or use the exodbctest-application with the parameter --createDb
to create the required test tables structure.
The test tables and their contents can be accessed through the TestedDatabases page.
The test application exodbctest
is based on Google Test. You can use all Google Test options to filter tests, change the output-type, etc. See the Google Test manual for the available options.
exOdbcTest provides some additional arguments to specify the connection information for the test database. You have to either specify the connection information on the command line (by referencing a configured DSN entry, or by a connection string) or exOdbcTest will search for a configuration file TestSettings.xml
See exodbcest --help
for more information about how TestSettings.xml
is located and all options and their syntax.
The TestSettings.xml
is an xml-file with the following structure:
<TestSettings>
<CreateDb>0</CreateDb>
<LogLevel>Debug</LogLevel>
<Dsn>
<Disabled>01</Disabled>
<Name>exMySql_64</Name>
<User>ex</User>
<Pass>extest</Pass>
<Case>lower</Case>
<Skip ticket="76">DatabaseTest.ReadTablePrivileges</Skip>
<Skip ticket="76">TableTest.CheckPrivileges</Skip>
<Skip ticket="120">StatementCloserTest.CloseStmtHandle</Skip>
<Workaround ticket="206">NumericColumnTest.Write_18_10_Value</Workaround>
</Dsn>
<ConnectionString>
<Disabled>1</Disabled>
<Value>Driver={SQL Server Native Client 11.0};Server=192.168.56.20\EXODBC;Database=exodbc;Uid=ex;Pwd=extest;</Value>
<Case>lower</Case>
</ConnectionString>
</TestSettings>
CreateDb
: If set to1
, the parameter--createDb
is activated.LogLevel
: Set the log level. Valid values areDebug
,Info
,Warning
andError
.Disabled
(inDsn
andConnectionString
elements): The firstDsn
orConnectionString
element in the file whereDisabled
is set to0
will be used to run the tests.Dsn
: Specify a DSN entry by passing the DSNName
,User
andPass
.ConnectionString
: Specify theValue
of a connection string to use.Case
(inDsn
andConnectionString
elements): Set tolower
if the test database uses table and column names in lower-case letters, or toupper
if the test database uses UPPERCASE table and column names.Skip
(inDsn
andConnectionString
elements): Some tests are known to fail on certain databases. Either because the setup of the test database is incorrect (and to complicated to fix), or because the driver does not support some ODBC feature, etc. The test known to fail are listed asSkip
elements. If no argument--gtest_filter
is already set, a--gtest_filter
argument is constructed which filters out the tests listed inSkip
elements. If an argument--gtest_filter
is already set, the argument is not modified andSkip
entries are ignored.Workaround
(inDsn
andConnectionString
elements): Just a hint that there is some sort of a workaround in the test to make the test pass and link to corresponding ticket.
There are several things that are known to fail when running the tests:
TODO: Recreate the list of failed things, see #5
See TestedDatabases for more information about known failures, and what drivers, database types etc. were used during the tests.