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. output test results to stdout using -o
Qt 6.11 is out! See what's new in the release blog

output test results to stdout using -o

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.0k 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.
  • B Offline
    B Offline
    Brynnjolf
    wrote on last edited by Brynnjolf
    #1

    The Qt Test overview specifies that the test log can be output to stdout this way: -o filename,format
    "
    "[-o filename,format] Writes output to the specified file, in the specified format (one of txt, xml, lightxml, xunitxml or tap). The special filename - may be used to log to standard output."

    Here it says that a special filename can be used to route it to stdout. I have tried using "-" as the filename but this doesn't register, and instead I get "-o needs an extra parameter specifying the filename and optional format"

    Any help would be greatly appreciated.

    Thanks!

    jsulmJ 1 Reply Last reply
    0
    • B Brynnjolf

      The Qt Test overview specifies that the test log can be output to stdout this way: -o filename,format
      "
      "[-o filename,format] Writes output to the specified file, in the specified format (one of txt, xml, lightxml, xunitxml or tap). The special filename - may be used to log to standard output."

      Here it says that a special filename can be used to route it to stdout. I have tried using "-" as the filename but this doesn't register, and instead I get "-o needs an extra parameter specifying the filename and optional format"

      Any help would be greatly appreciated.

      Thanks!

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

      @Brynnjolf Did you also specify the format?

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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Brynnjolf
        wrote on last edited by
        #3

        yeah, the syntax I've used is -o -,txt

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

          https://doc.qt.io/qt-5/qtest-overview.html#options

          just use -txt

          "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
          • B Offline
            B Offline
            Brynnjolf
            wrote on last edited by Brynnjolf
            #5

            I should have specified that I am trying to log in multiple formats simultaneously. My bad.

            From your link:
            "The first version of the -o option (-o filename,format), may be repeated in order to log test results in multiple formats, but no more than one instance of this option can log test results to standard output."

            So, if I want to log to a file and stdout simultaneously, I believe this is the only option.

            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