Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to combine all tests in one XML report
Forum Updated to NodeBB v4.3 + New Features

How to combine all tests in one XML report

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 653 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sebastienc
    wrote on last edited by
    #1

    Hello all,

    I am working on a test projet which contains many test classes. This is the main function of the project :

    int main(int argc, char** argv) {
        int status = 0;
    
        Test_AbstractCanMessage test_abstractcanmessage;
        status |= QTest::qExec(&test_abstractcanmessage, argc, argv);
    
        Test_RequestCanMessage test_requestcanmessage;
        status |= QTest::qExec(&test_requestcanmessage, argc, argv);
    
        return status;
    }
    

    And the app output :

    ********* Start testing of Test_AbstractCanMessage *********
    Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
    QML debugging is enabled. Only use this in a safe environment.
    PASS   : Test_AbstractCanMessage::initTestCase()
    PASS   : Test_AbstractCanMessage::test_constructor_empty()
    PASS   : Test_AbstractCanMessage::test_constructor_from_raw()
    PASS   : Test_AbstractCanMessage::test_constructor_from_string(empty string)
    PASS   : Test_AbstractCanMessage::test_constructor_from_string(zero filling 1)
    PASS   : Test_AbstractCanMessage::test_constructor_from_string(zero filling 2)
    PASS   : Test_AbstractCanMessage::test_constructor_from_string(zero filling 3)
    PASS   : Test_AbstractCanMessage::test_constructor_from_string(ascii conversion)
    PASS   : Test_AbstractCanMessage::test_constructor_from_unsigned_int(zero)
    PASS   : Test_AbstractCanMessage::test_constructor_from_unsigned_int(maximum)
    PASS   : Test_AbstractCanMessage::test_constructor_from_unsigned_int(random)
    PASS   : Test_AbstractCanMessage::test_constructor_from_unsigned_int(one)
    PASS   : Test_AbstractCanMessage::test_is_valid_serialized_can_frame(Valid minimal value)
    PASS   : Test_AbstractCanMessage::test_is_valid_serialized_can_frame(Valid maximal value)
    PASS   : Test_AbstractCanMessage::test_is_valid_serialized_can_frame(Valid random frame)
    PASS   : Test_AbstractCanMessage::test_is_valid_serialized_can_frame(Size too short)
    PASS   : Test_AbstractCanMessage::test_is_valid_serialized_can_frame(Size too high)
    PASS   : Test_AbstractCanMessage::test_is_valid_serialized_can_frame(Invalid CAN ID)
    PASS   : Test_AbstractCanMessage::test_from_serialized_can_frame(Empty frame)
    PASS   : Test_AbstractCanMessage::test_from_serialized_can_frame(Size too low)
    PASS   : Test_AbstractCanMessage::test_from_serialized_can_frame(Size too high)
    PASS   : Test_AbstractCanMessage::test_from_serialized_can_frame(Invalid CAN ID)
    PASS   : Test_AbstractCanMessage::test_from_serialized_can_frame(Random valid)
    PASS   : Test_AbstractCanMessage::test_serialize(Empty frame)
    PASS   : Test_AbstractCanMessage::test_serialize(Invalid can id)
    PASS   : Test_AbstractCanMessage::test_serialize(Size too low)
    PASS   : Test_AbstractCanMessage::test_serialize(Size too high)
    PASS   : Test_AbstractCanMessage::test_serialize(Random valid)
    PASS   : Test_AbstractCanMessage::test_serialize(Can ID size low)
    PASS   : Test_AbstractCanMessage::test_is_valid(Empty frame)
    PASS   : Test_AbstractCanMessage::test_is_valid(Invalid can id)
    PASS   : Test_AbstractCanMessage::test_is_valid(Size too low)
    PASS   : Test_AbstractCanMessage::test_is_valid(Size too high)
    PASS   : Test_AbstractCanMessage::test_is_valid(Random valid)
    PASS   : Test_AbstractCanMessage::test_is_valid(Can ID size low)
    PASS   : Test_AbstractCanMessage::test_set_can_id()
    PASS   : Test_AbstractCanMessage::test_get_can_id()
    PASS   : Test_AbstractCanMessage::cleanupTestCase()
    Totals: 38 passed, 0 failed, 0 skipped, 0 blacklisted, 2ms
    ********* Finished testing of Test_AbstractCanMessage *********
    ********* Start testing of Test_RequestCanMessage *********
    Config: Using QtTest library 5.11.3, Qt 5.11.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
    PASS   : Test_RequestCanMessage::initTestCase()
    PASS   : Test_RequestCanMessage::test_constructor_empty()
    PASS   : Test_RequestCanMessage::cleanupTestCase()
    Totals: 3 passed, 0 failed, 0 skipped, 0 blacklisted, 0ms
    ********* Finished testing of Test_RequestCanMessage *********
    

    When I generate a xunit report with ./test_project -o report.xml,xunitxml, only the last Test Suite appears in the report.

    My question : Is there an easy way to combine all test suites of a test project in a single report ?

    Thrank you

    sc

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sebastienc
      wrote on last edited by
      #2

      After some tests and research, I finally decided to use GoogleTest instead of QtTest ... The report generated with GoogleTest contains all the tests within the project.

      1 Reply Last reply
      0
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #3

        The Qt test framework is designed to have 1 class per project without concatenations, the feature you want is not present just because you are forcing the framework to do something it shouldn't do

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        2
        • S Offline
          S Offline
          sebastienc
          wrote on last edited by
          #4

          I am aware that it should work this way.

          I need to generate one or more XML reports of my test cases.

          So let's imagine that I have a subdir project with several test cases inside. After construction, how can I generate an XML report for each sub-project at a time?

          Thank you

          V 1 Reply Last reply
          0
          • S sebastienc

            I am aware that it should work this way.

            I need to generate one or more XML reports of my test cases.

            So let's imagine that I have a subdir project with several test cases inside. After construction, how can I generate an XML report for each sub-project at a time?

            Thank you

            V Offline
            V Offline
            Vijay R. Gawade
            wrote on last edited by
            #5

            @sebastienc Any updates?

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved