Gammu Testsuite
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:
make test
Runs testsuite with no uploading of results.
make Experimental
Runs testsuite and uploads results to the dashboard.
make ExperimentalMemCheck
This checks memory accesses using valgrind during tests and submits report. You need to do this after
make Experimentaland you can submit results usingmake ExperimentalSubmit.
Coverage reports
To get test coverage reports, you need to configure project using
cmake -DCOVERAGE=ON
Nightly testing
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 ormake 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-nameAdding
-Vruns it in verbose mode with all test output:ctest -V -R test-name
Collecting results
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:
MYSQL_TESTING:you need to have setup MySQL server with database where SMSD can play.
PSQL_TESTINGyou 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:
ONLINE_TESTING: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
The tests directory contains various tests which do inject data into
reply functions and check their response.
Testing of data parsing
The 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
SH_BINPath to the sh program
BASH_BINPath to the bash program
SQLITE_BINPath to the sqlite3 program
SED_BINPath to the sed program
MYSQL_BINPath to the mysql program
PSQL_BINPath to the psql program
Limiting testsuite
ONLINE_TESTINGEnable testing of parts which use remote servers, requires connection to interned
PSQL_TESTINGEnable testing of PostgreSQL SMSD backend, requires configured PostgreSQL database
MYSQL_TESTINGEnable testing of MySQL SMSD backend, requires configured MySQL database
Database backends configuration
PSQL_HOSTHost to use for PostgreSQL tests (default:
127.0.0.1)PSQL_DATABASEDatabase to use for PostgreSQL tests (default:
smsd)PSQL_USERUser to use for PostgreSQL tests (default:
smsd)PSQL_PASSWORDPassword to use for PostgreSQL tests (default:
smsd)MYSQL_HOSTHost to use for MySQL tests (default:
127.0.0.1)MYSQL_DATABASEDatabase to use for MySQL tests (default:
smsd)MYSQL_USERUser to use for MySQL tests (default:
smsd)MYSQL_PASSWORDPassword to use for MySQL tests (default:
smsd)ODBC_DSN`ODBC DSN to use for ODBC tests (default:
smsd). Currently needs to point to MySQL database.