Gammu comes with quite big test suite. It covers some basic low level functions, handling replies from the phone and also does testing of command line utilities and SMSD.
Running the tests¶
You can run the test suite this using
make test. CMake build system uses
for testing CTest, which also includes option to connect to dashboard and
submit test results there, so that they can be reviewed and fixed by others. To
participate in this testing, you need just to run
make Experimental which
also does submission to the dashboard.
There are some more options for testing:
Runs testsuite with no uploading of results.
Runs testsuite and uploads results to the dashboard.
This checks memory accesses using valgrind during tests and submits report. You need to do this after
make Experimentaland you can submit results using
To get test coverage reports, you need to configure project using
Currently several machines do compile and test Gammu every night. If you want to tak part of this, just ensure that your machine executes test suite every night (preferably after 3:00 CET). You can select either
make Nightlyto do regular testing or
make NightlyMemoryCheckto test with valgrind. Also you can enable coverage tests as described above.
Running single test
You can run single test by directly calling ctest:ctest -R test-name
-Vruns it in verbose mode with all test output:ctest -V -R test-name
The tests are ran daily on several platforms and you can find the results on Travis.
The coverage reports are at Coveralls.
Testing of SMSD¶
SMSD tests are performed using Dummy Driver and uses file backend and sqlite database by default. For this you nee Gammu compiled with libdbi, have installed sqlite driver for libdbi and have sqlite3 binary available on the system.
Testing of additional database backends must be enabled separately:
you need to have setup MySQL server with database where SMSD can play.
you need to have setup PostgreSQL server with database where SMSD can play.
Testing of command line utility¶
Gammu command line tests are performed using Dummy Driver where required. It covers most of command line interface, but some parts need to be explicitly enabled:
enable testing of features which require internet access
Testing of Python interface¶
Python module tests are performed using Dummy Driver where required. It does also cover testing of SMSD interface, which is done using libdbi(sqlite) driver.
Testing of reply functions¶
tests directory contains various tests which do inject data into
reply functions and check their response.
Testing of data parsing¶
tests directory contains various tests which just try to parse
various file formats supported by libGammu.
Configuration of the test suite¶
You can pass various parameters to configure the test suite:
Programs used for testing¶
Path to the sh program
Path to the bash program
Path to the sqlite3 program
Path to the sed program
Path to the mysql program
Path to the psql program
Enable testing of parts which use remote servers, requires connection to interned
Enable testing of PostgreSQL SMSD backend, requires configured PostgreSQL database
Enable testing of MySQL SMSD backend, requires configured MySQL database
Database backends configuration¶
Host to use for PostgreSQL tests (default:
Database to use for PostgreSQL tests (default:
User to use for PostgreSQL tests (default:
Password to use for PostgreSQL tests (default:
Host to use for MySQL tests (default:
Database to use for MySQL tests (default:
User to use for MySQL tests (default:
Password to use for MySQL tests (default:
ODBC DSN to use for ODBC tests (default:
smsd). Currently needs to point to MySQL database.