0

I created a Qt test which invokes another program thanks to a QProcess. After calling the QProcess::start method, my test waits for it to finish with the QProcess::waitForFinished method. When I run this test with Qt Creator, there's no problem. But when I run it with CTest, the QProcess::waitForFinished function always returns false. Can someone explain me why ? Thank you.

Erwan
  • 41
  • 6
  • Hard to say without seeing the code. Are you specifying the child process’s executable via a relative path? If so, perhaps CTest has a different current directory and therefore can’t find the executable to run. – Jeremy Friesner Feb 04 '22 at 23:55

1 Answers1

0

Finally, I found a solution : the QProcess:start method couldn't find the program because the working directory of my Qt test wasn't good. So, I changed it with the QDir::setCurrent and now, it works.

Erwan
  • 41
  • 6