diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-12-22 10:38:48 +0200 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-12-22 12:09:30 +0000 |
commit | 5422c0cdfcdbd58182141be78343c1b4863a6198 (patch) | |
tree | 1a8a8e39c10d6a8689992652be150315dc5503a5 /tests | |
parent | 7828f6f9c4f49afc4583d67b42ce31323256312a (diff) |
Tests: fix 'make check' failing after consecutive calls
The 'elevatedexecuteoperation' test invoked qmake in its project file
directory when ran, overwriting the original Makefile. This would cause
problems on the consecutive "make check" invocations after first, if
qmake was originally ran with a custom command line arguments. For
example, setting 'CONFIG+=libarchive' would be lost and the test would
try to link against the default lib7z.a, which would not be found on
libarchive enabled builds.
Fix by calling the qmake executable with the version option instead,
we just need to check that the executable could be started, no need
to actually run it for the test sub-project.
Change-Id: Ie10c1622fa529c1338d427b7c757f8cc5834e0ac
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/installer/elevatedexecuteoperation/tst_elevatedexecuteoperation.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/auto/installer/elevatedexecuteoperation/tst_elevatedexecuteoperation.cpp b/tests/auto/installer/elevatedexecuteoperation/tst_elevatedexecuteoperation.cpp index aa2849559..ef185a5cf 100644 --- a/tests/auto/installer/elevatedexecuteoperation/tst_elevatedexecuteoperation.cpp +++ b/tests/auto/installer/elevatedexecuteoperation/tst_elevatedexecuteoperation.cpp @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -46,12 +46,12 @@ private slots: m_core.setValue(QLatin1String("QMAKE_BINARY"), QUOTE(QMAKE_BINARY)); m_core.setValue(QLatin1String("QMAKE_BINARY_OLD"), QLatin1String("FAKE_QMAKE")); ElevatedExecuteOperation operation(&m_core); - operation.setArguments(QStringList() << QLatin1String("UNDOEXECUTE") << QLatin1String("FAKE_QMAKE")); + operation.setArguments(QStringList() << QLatin1String("UNDOEXECUTE") << QLatin1String("FAKE_QMAKE") << QLatin1String("-v")); - QTest::ignoreMessage(QtDebugMsg, "\"FAKE_QMAKE\" started, arguments: \"\""); - QString message = "Failed to run undo operation \"Execute\" for component . Trying again with arguments %1"; + QTest::ignoreMessage(QtDebugMsg, "\"FAKE_QMAKE\" started, arguments: \"-v\""); + QString message = "Failed to run undo operation \"Execute\" for component . Trying again with arguments %1, -v"; QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(QUOTE(QMAKE_BINARY)))); - message = "\"%1\" started, arguments: \"\""; + message = "\"%1\" started, arguments: \"-v\""; QTest::ignoreMessage(QtDebugMsg, qPrintable(message.arg(QUOTE(QMAKE_BINARY)))); QCOMPARE(operation.undoOperation(), true); |