Results 1 to 7 of 7

Thread: How to get the STDOUT from a QTestLib DLL?

  1. #1
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    5
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to get the STDOUT from a QTestLib DLL?

    Hello!

    I've been looking now for hours to find a way how to output the STDOUT/STDERR from a DLL.
    I have a Testclass inheriting QObject. I have test cases.

    Output works fine, creating an .exe
    Output doesn't work of course, creating an .dll

    I've been trying to connect the stdout handle to a QFile in the hope, it would write into it, so i can read it after that.
    File was always empty (probably STDOUT wasn't generated at all)

    I've been trying to connect the stdout handle to a QTextStream in the hope, i could flush() it after QTest::qExec() and read the content of it.
    But again there is nothing to read.

    So... in the meantime i think there's probably no way to read a .dll's STDOUT because there is none, right?
    Help!

  2. #2
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    5
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the STDOUT from a QTestLib DLL?

    Is this thread stupid?
    Or have I answered myself?

    Thanks in advance

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to get the STDOUT from a QTestLib DLL?

    I cannot imagine that there is a stdout/stderr/stdin for a dynamically loaded library.

    What output are you trying to capture?

  4. #4
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    5
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the STDOUT from a QTestLib DLL?

    The one of QTestLib.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to get the STDOUT from a QTestLib DLL?

    You want to capture the output of a QTestLib test executable? Have you seen the -o option in the TestLib manual?

  6. #6
    Join Date
    Sep 2011
    Posts
    14
    Thanks
    5
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get the STDOUT from a QTestLib DLL?

    No, not an executable. A .dll.

  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to get the STDOUT from a QTestLib DLL?

    I have no idea what you are after then. The QTestLib DLL only orchestrates running the slots in your executable: the slots generate the output and it goes either to stdout or where the -o option points.

Similar Threads

  1. QTestlib - How to add own types
    By AlGaN in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2010, 19:22
  2. qtestlib
    By Jordan in forum Qt Programming
    Replies: 7
    Last Post: 28th September 2010, 11:47
  3. How to use QTestLib to my project??
    By Klaxuz in forum Newbie
    Replies: 1
    Last Post: 3rd June 2010, 14:57
  4. testing with QTestLib
    By hyling in forum Qt Programming
    Replies: 2
    Last Post: 12th July 2007, 20:37
  5. fstream -> stdout
    By zlatko in forum General Programming
    Replies: 11
    Last Post: 25th January 2006, 05:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.