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 run all unit-tests on macOS?
QtWS25 Last Chance

How to run all unit-tests on macOS?

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 593 Views
  • 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.
  • N Offline
    N Offline
    ntt2899
    wrote on last edited by
    #1

    I want to run all unit-test and get reports at xml format. I use python script to run the unit-test one by one with -xml argument. It's work on Windows OS. But on Mac OS, i haven't figured out a way to include all unit-test executables into a single bundle for deploying purpose before running test.
    Anyone have experience to run and get reports for all unit-tests on MacOs? Could you give me a hint ?
    I have also see a guide at https://forum.qt.io/topic/93997/qtest-how-to-aggregate-all-my-unit-tests-in-one-main-test . But I know that "QTest encourages you to organize unit tests as separate executables" , So i think this way is not encouraged .
    Thanks bro

    jsulmJ 1 Reply Last reply
    0
    • N ntt2899

      I want to run all unit-test and get reports at xml format. I use python script to run the unit-test one by one with -xml argument. It's work on Windows OS. But on Mac OS, i haven't figured out a way to include all unit-test executables into a single bundle for deploying purpose before running test.
      Anyone have experience to run and get reports for all unit-tests on MacOs? Could you give me a hint ?
      I have also see a guide at https://forum.qt.io/topic/93997/qtest-how-to-aggregate-all-my-unit-tests-in-one-main-test . But I know that "QTest encourages you to organize unit tests as separate executables" , So i think this way is not encouraged .
      Thanks bro

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @ntt2899 said in How to run all unit-tests on macOS?:

      include all unit-test executables into a single bundle

      Why do you want to do this? Unit tests are usually build as executables: one unit test unit - one executable.
      "deploying purpose" - deploy to where?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      N 1 Reply Last reply
      2
      • jsulmJ jsulm

        @ntt2899 said in How to run all unit-tests on macOS?:

        include all unit-test executables into a single bundle

        Why do you want to do this? Unit tests are usually build as executables: one unit test unit - one executable.
        "deploying purpose" - deploy to where?

        N Offline
        N Offline
        ntt2899
        wrote on last edited by
        #3

        Hi @jsulm
        Yes, we use QTDIR/bin/macdeployqt to copy the libraries to the bundle. But in my case, almost the unit-test use same qt libraries. So I want to include all the unit-test executable to a single bundle to deploy one time for all instead of deploying for each unit test bundle.
        Actually, i am not sure my solution is right way :( . Please help to correct me.
        My purpose, run all unit-tests (~30 test suites) and report at xml format for each test-suite

        jsulmJ 1 Reply Last reply
        0
        • N ntt2899

          Hi @jsulm
          Yes, we use QTDIR/bin/macdeployqt to copy the libraries to the bundle. But in my case, almost the unit-test use same qt libraries. So I want to include all the unit-test executable to a single bundle to deploy one time for all instead of deploying for each unit test bundle.
          Actually, i am not sure my solution is right way :( . Please help to correct me.
          My purpose, run all unit-tests (~30 test suites) and report at xml format for each test-suite

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @ntt2899 But why do you want to deploy unit test executables?!
          They are usually not deployed, just executed after build.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          N 1 Reply Last reply
          1
          • jsulmJ jsulm

            @ntt2899 But why do you want to deploy unit test executables?!
            They are usually not deployed, just executed after build.

            N Offline
            N Offline
            ntt2899
            wrote on last edited by
            #5

            @jsulm said in How to run all unit-tests on macOS?:

            o you want to deploy unit test executables?!

            Because when i run the executables from terminal without using macdeployqt i get a issue"
            "dyld: Library not loaded: @rpath/QtCore.framework/Versions/5/QtCore"

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              What version of Qt are you using ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              N 1 Reply Last reply
              0
              • SGaistS SGaist

                What version of Qt are you using ?

                N Offline
                N Offline
                ntt2899
                wrote on last edited by
                #7

                @SGaist Yes, I am using Qt 5.13.2

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Are you using a standard QTest project ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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