[bt-devel] Using QTest with BibleTime

Gary Holmlund gary.holmlund at gmail.com
Wed Nov 25 10:05:06 MST 2015


I have started work on tests for BibleTime code using Qt QTest. The goal 
is to make it easy to automatically test code changes before they are 
checked in. Running the tests is done by typing "ctest" in the build 
directory. It will run all tests and provide a summary of the results.

The best way to use these tests is for each developer to run them before 
checking in code. If an error occurs, that developer should either fix a 
bug they created, or modify the failing test if new behavior is expected.

I have written tests for the public functions in CSwordBackend and 
CSwordVerseKey. I am ready to check these in. This is just a small start 
in the list of classes we should test. I would gladly like others to 
help in this process.

So, is this a direction we want to take with BibleTime?

Gary


============= More details =====

bibletime/tests

These directories are for tests of BibleTime classes and functions. They use
the Qt test framework as described in Qt documentaion. See QTest and 
qtestlib.

The tests for backend classes are not necessarily unit tests. Since many 
classes
are wrappers around sword functionality, it seems best to test classes based
on sword by including sword in the test program.


Building

The tests are automatically built in the build directory. They do not 
have to
be installed to run.


Running

The tests currently require the following modules to be installed.
KJV, KJVA, Scofield, Josephus, and StrongGreek

Running all test programs and summarizing the results can be done by running
"ctest" in the build directory. CMake provides the "ctest" program.

Running an individual test for a specific class is done by running the test
program for that class. This in normally "test_" plus the lowercase 
class name
like test_cswordversekey.


Errors

If an error occurs with an existing test, either there is a problem in the
BibleTime source or the test needs to be updated for the change in 
functionality.
Please keep all tests passing.




More information about the bt-devel mailing list