PDA

View Full Version : How to get the STDOUT from a QTestLib DLL?



entonjackson
18th October 2011, 09:25
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!

entonjackson
19th October 2011, 07:59
Is this thread stupid?
Or have I answered myself?

Thanks in advance

ChrisW67
19th October 2011, 09:05
I cannot imagine that there is a stdout/stderr/stdin for a dynamically loaded library.

What output are you trying to capture?

entonjackson
19th October 2011, 09:06
The one of QTestLib.

ChrisW67
19th October 2011, 09:36
You want to capture the output of a QTestLib test executable? Have you seen the -o option in the TestLib manual?

entonjackson
19th October 2011, 09:37
No, not an executable. A .dll.

ChrisW67
19th October 2011, 10:02
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.