[bt-devel] Using QTest with BibleTime

Jaak Ristioja jaak at ristioja.ee
Sun Jul 24 15:08:13 MST 2016


As a sidenote and not to start a discussion, I think that QTest is
probably not the framework we want to be using in the long term.

I'm also a bit sceptical whether anyone has much time to write tests,
but when do you think you could integrate this with our CI? :-)

J

On 28.11.2015 15:12, Martin Gruner wrote:
> This is excellent, Gary!
> 
> Am 25.11.15 um 18:05 schrieb Gary Holmlund:
>> 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.
>>
>>
>> _______________________________________________
>> bt-devel mailing list
>> bt-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/bt-devel
>>
> 
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
> 




More information about the bt-devel mailing list