Skip to content

QtTestDriverTest doesn't get built nor executed and leaks #190

Closed
@muggenhor

Description

@muggenhor

Because of a typo in tests/CMakeLists.txt QtTestDriverTest doesn't get built and thus not executed either:

if(Qt5TEST_FOUND)

This should be (note the title case instead of full upper case):

if(Qt5Test_FOUND)

When fixing that however, I'm getting a memory leak: https://travis-ci.org/muggenhor/cucumber-cpp/jobs/381075041

@konserw Given that you originally introduced the QtTest driver in #165, can you have a look at this and try to fix it?

This is the output:

108/109 Test #108: QtTestDriverTest .................................................................***Failed    1.26 sec
==10192== Memcheck, a memory error detector
==10192== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==10192== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==10192== Command: /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest
==10192== 
SUCCESS (The test body has not been run)
SUCCESS (The test body has been run)
= Step invocation =
SUCCESS (Succeeding step)
SUCCESS (Failing step)
SUCCESS (Failing step has a message)
SUCCESS (Pending step with no description - result)
SUCCESS (Pending step with no description - description)
SUCCESS (Pending step with description - result)
SUCCESS (Pending step with description - description)
SUCCESS (Inexistent step)
= Constructors and destructors =
== Succeeding step ==
SUCCESS (Contexts created after invoke)
SUCCESS (Contexts destroyed after invoke)
SUCCESS (Contexts created after end scenario)
SUCCESS (Contexts destroyed after end scenario)
== Failing step ==
SUCCESS (Contexts created after invoke)
SUCCESS (Contexts destroyed after invoke)
SUCCESS (Contexts created after end scenario)
SUCCESS (Contexts destroyed after end scenario)
= Step failure description is reset =
SUCCESS (Failing step description is set)
SUCCESS (Failing step description is the same)
==10192== 
==10192== HEAP SUMMARY:
==10192==     in use at exit: 116 bytes in 3 blocks
==10192==   total heap usage: 734 allocs, 731 frees, 68,470 bytes allocated
==10192== 
==10192== 4 bytes in 1 blocks are definitely lost in loss record 1 of 3
==10192==    at 0x4C2B0E0: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10192==    by 0x60EBAF1: qrand() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x623974B: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x62146D1: QFile::open(QFlags<QIODevice::OpenModeFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x6239DC2: QTemporaryFile::open(QFlags<QIODevice::OpenModeFlag>) (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x45F463: QTemporaryFile::open() (in /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest)
==10192==    by 0x45EDE1: cucumber::internal::QtTestStep::invokeStepBody() (in /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest)
==10192==    by 0x445536: QtTestStepDouble::invokeStepBody() (in /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest)
==10192==    by 0x4455E7: QtTestDriverTest::stepInvocationRunsStepBody() (in /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest)
==10192==    by 0x445567: QtTestDriverTest::runAllTests() (in /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest)
==10192==    by 0x444570: cucumber::internal::DriverTest::run() (in /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest)
==10192==    by 0x4434BD: main (in /home/travis/build/muggenhor/cucumber-cpp/build/tests/QtTestDriverTest)
==10192== 
==10192== 56 bytes in 1 blocks are still reachable in loss record 2 of 3
==10192==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10192==    by 0x7350B58: UDataMemory_createNewInstance_52 (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x734ECCA: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x734F629: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x734F83D: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x735015B: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x735C59B: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x735D2B9: ucnv_getStandardName_52 (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x63252CB: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x6325DDC: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x6321D66: QTextCodec::codecForLocale() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x6182C40: QString::toLocal8Bit() const (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192== 
==10192== 56 bytes in 1 blocks are still reachable in loss record 3 of 3
==10192==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==10192==    by 0x7350B58: UDataMemory_createNewInstance_52 (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x734EC9C: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x734F888: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x735015B: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x735C59B: ??? (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x735D2B9: ucnv_getStandardName_52 (in /usr/lib/x86_64-linux-gnu/libicuuc.so.52.1)
==10192==    by 0x63252CB: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x6325DDC: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x6321D66: QTextCodec::codecForLocale() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x6182C40: QString::toLocal8Bit() const (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192==    by 0x626CC38: ??? (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.2.1)
==10192== 
==10192== LEAK SUMMARY:
==10192==    definitely lost: 4 bytes in 1 blocks
==10192==    indirectly lost: 0 bytes in 0 blocks
==10192==      possibly lost: 0 bytes in 0 blocks
==10192==    still reachable: 112 bytes in 2 blocks
==10192==         suppressed: 0 bytes in 0 blocks
==10192== 
==10192== For counts of detected and suppressed errors, rerun with: -v
==10192== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions