From 9a4cae42c00ad1f845e1ab8fb650a7c2c08e6ee1 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 5 Jun 2024 13:20:35 +0200 Subject: [PATCH] Tests: Make environment test less verbose Only print out additional information if the environment does not match the expected one. Change-Id: I9be1a90400a180a4cbd0381f54eea79409c007c7 Reviewed-by: Christian Kandeler --- tests/auto/environment/tst_environment.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/auto/environment/tst_environment.cpp b/tests/auto/environment/tst_environment.cpp index 251ad4d496a..58ee3a72a51 100644 --- a/tests/auto/environment/tst_environment.cpp +++ b/tests/auto/environment/tst_environment.cpp @@ -377,9 +377,12 @@ void tst_Environment::pathChanges() else environment.appendOrSet(variable, value); - qDebug() << "Actual :" << environment.toStringList(); - qDebug() << "Expected:" << expected.toStringList(); - QCOMPARE(environment, expected); + const bool envEqualsExpected = environment == expected; + if (!envEqualsExpected) { + qDebug() << "Actual :" << environment.toStringList(); + qDebug() << "Expected:" << expected.toStringList(); + } + QVERIFY(envEqualsExpected); } void tst_Environment::find_data()