Autotest: Use FilePath::searchInDirectories

FilePath::searchInDirectories handles absolute paths on devices
better unlike Environment::searchInPath() which requires
a QString argument.

Previously the device:// part was dropped when trying to run
remote tests.

Fixes: QTCREATORBUG-29183
Change-Id: Idd04cdb8798d04abf88ab6cb4b68eb73d890a482
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-06-20 10:42:07 +02:00
parent 67ec9bbce0
commit f29b54d8a1

View File

@@ -57,9 +57,10 @@ FilePath ITestConfiguration::executableFilePath() const
if (!hasExecutable())
return {};
const Environment env = m_runnable.environment.hasChanges()
? m_runnable.environment : Environment::systemEnvironment();
return env.searchInPath(m_runnable.command.executable().path());
const Environment env = m_runnable.environment.appliedToEnvironment(
m_runnable.command.executable().deviceEnvironment());
return m_runnable.command.executable().searchInDirectories(env.path());
}
Environment ITestConfiguration::filteredEnvironment(const Environment &original) const