Skip to content

Commit 5293857

Browse files
committed
fix: stabilize system integration test temp scripts
1 parent b1f3614 commit 5293857

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

tests/test_system_integration.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@
99
#include "system/dnfmanager.h"
1010
#include "system/polkit.h"
1111

12+
namespace {
13+
14+
QTemporaryDir createExecutableTempDir() {
15+
const QString basePath =
16+
QDir::cleanPath(QDir::currentPath() + QStringLiteral("/ro-control-test-XXXXXX"));
17+
return QTemporaryDir(basePath);
18+
}
19+
20+
}
21+
1222
class TestSystemIntegration : public QObject {
1323
Q_OBJECT
1424

1525
private slots:
1626
void testCommandRunnerUsesProgramOverride() {
17-
QTemporaryDir tempDir;
27+
QTemporaryDir tempDir = createExecutableTempDir();
1828
QVERIFY(tempDir.isValid());
1929

2030
const QString scriptPath = tempDir.filePath(QStringLiteral("fake-dnf.sh"));
@@ -37,7 +47,7 @@ private slots:
3747
}
3848

3949
void testCapabilityProbeUsesProgramOverride() {
40-
QTemporaryDir tempDir;
50+
QTemporaryDir tempDir = createExecutableTempDir();
4151
QVERIFY(tempDir.isValid());
4252

4353
const QString scriptPath =

0 commit comments

Comments
 (0)