KDb/Tests: Difference between revisions

From KDE Community Wiki
< KDb
Line 12: Line 12:


==Functional tests==
==Functional tests==
Functional test use many parts of the APIs. They can be also used by newcomers to learn how to use Predicate APIs.
Functional test '''predicatefeaturestest''' uses many parts of the APIs. They can be also used by newcomers to learn how to use Predicate APIs.
predicatefeaturestest is built during the [[../Build/|default build]] of Predicate, although it is not installed on ''make install''.  


To run the predicatefeaturestest test:
  $ cd {BUILDDIR}/tests/features
  $ cd {BUILDDIR}/tests/features
  $ less README # read README file
  $ less README # read README file to


1. Full test for database, tables and data creation for SQLite:
1. Full test for database, tables and data creation for SQLite:
Line 27: Line 29:
On success, mysqltest server database will be created and the test says:
On success, mysqltest server database will be created and the test says:
  main: "tables" test: PASSED
  main: "tables" test: PASSED
Similarly to MySQL, predicatefeaturestest can run on top of PostgreSQL database (the driver is called ''postgresql'').

Revision as of 15:05, 27 June 2012

Unit tests

Predicate has complex functionality and should be covered by unit tests.

Warning

The current unit test coverage in Predicate is poor. Volunteers wanted!


Running unit tests

$ cd {BUILDDIR}/Predicate/tests
$ ctest --verbose

HOWTOs

Functional tests

Functional test predicatefeaturestest uses many parts of the APIs. They can be also used by newcomers to learn how to use Predicate APIs. predicatefeaturestest is built during the default build of Predicate, although it is not installed on make install.

To run the predicatefeaturestest test:

$ cd {BUILDDIR}/tests/features
$ less README # read README file to 

1. Full test for database, tables and data creation for SQLite:

$ ./predicatefeaturestest -t tables sqlite sqlitetest

On success, sqlitetest file will be created and the test says:

main: "tables" test: PASSED

2. Full test for database, tables and data creation for MySQL server:

$ ./predicatefeaturestest -p {mysql_password} -u {mysql_user} -t tables mysql mysqltest

On success, mysqltest server database will be created and the test says:

main: "tables" test: PASSED

Similarly to MySQL, predicatefeaturestest can run on top of PostgreSQL database (the driver is called postgresql).