-
Notifications
You must be signed in to change notification settings - Fork 43
Running the test suite
To run the Links test suite execute:
./run-tests
This will run all the tests defined in *.tests
files inside tests
directory, as well as all database tests defined inside tests/database
directory. If you only want to run some of the tests you can do this by executing
./test-harness tests/foo.tests
where foo.tests
is the name of the file with tests you want to run. If you want to skip tests requiring database access run
./run-tests no-db
If you want to run only those tests that require database access run
./run-tests db-only
To run the tests requiring database access you need to setup PostgreSQL database. Refer to Database setup for instructions how to compile Links with PostgreSQL support. You also need to create links
database and have permissions to access it.
To run shredding tests, run
./run-tests db-only shredding
To configure tests to run using an alternate database configuration (user+password/host), edit the config files in tests/{database,shredding}/config. These are created from the respective sample files if they do not exists, but will not be overwritten if they are already there.
Each database test should consist of a pair of files: SQL database setup script (.sql
extensions) + Links test code (.links
extension). Both files should have identical base name and should be placed in a directory containing database tests (at the moment tests/database/
and tests/shredding
are such directories). Each directory contains:
-
config.sample
- a default database configuration for tests in a given directory -
config
- actual database configuration for tests in a given directory. This file is ignored by git and can be freely edited to match the local database steup. Ifconfig
file does not exist it will be created fromconfig.sample
byrun-tests
script. -
testsuite.config
- list of tests to run from a given directory. Each line should contain a name of a test to run. If a test is known to fail precede its name with wordBROKEN
, e.g.BROKEN xpath
.