From c43a6ab86630c77bc3187f59b4be4c6b180f5a8b Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 3 Feb 2021 00:46:34 +0100 Subject: [PATCH] [partition] Improve logging in automount test - switch logging in job to VERBOSE because we don't want to be printing pointers to the regular session log - switch logging in test to VERBOSE to actually see the messages from the Job - hook the test into the build --- src/modules/partition/jobs/AutoMountManagementJob.cpp | 2 +- src/modules/partition/tests/AutoMountTests.cpp | 2 +- src/modules/partition/tests/CMakeLists.txt | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modules/partition/jobs/AutoMountManagementJob.cpp b/src/modules/partition/jobs/AutoMountManagementJob.cpp index 2ea23666c..7ce3ac930 100644 --- a/src/modules/partition/jobs/AutoMountManagementJob.cpp +++ b/src/modules/partition/jobs/AutoMountManagementJob.cpp @@ -25,7 +25,7 @@ AutoMountManagementJob::prettyName() const Calamares::JobResult AutoMountManagementJob::exec() { - cDebug() << "this" << Logger::Pointer( this ) << "value" << Logger::Pointer( m_stored.get() ); + Logger::CDebug(Logger::LOGVERBOSE) << "this" << Logger::Pointer( this ) << "value" << Logger::Pointer( m_stored.get() ); if ( m_stored ) { CalamaresUtils::Partition::automountRestore( m_stored ); diff --git a/src/modules/partition/tests/AutoMountTests.cpp b/src/modules/partition/tests/AutoMountTests.cpp index b31b8cbc5..f09cd3d97 100644 --- a/src/modules/partition/tests/AutoMountTests.cpp +++ b/src/modules/partition/tests/AutoMountTests.cpp @@ -37,7 +37,7 @@ AutoMountJobTests::AutoMountJobTests() {} void AutoMountJobTests::testRunThrice() { - Logger::setupLogLevel( Logger::LOGDEBUG ); + Logger::setupLogLevel( Logger::LOGVERBOSE ); auto original = CalamaresUtils::Partition::automountDisable( true ); cDebug() << "Got automount info" << Logger::Pointer( original.get() ); diff --git a/src/modules/partition/tests/CMakeLists.txt b/src/modules/partition/tests/CMakeLists.txt index f16435230..8edef484c 100644 --- a/src/modules/partition/tests/CMakeLists.txt +++ b/src/modules/partition/tests/CMakeLists.txt @@ -58,3 +58,11 @@ calamares_add_test( DEFINITIONS ${_partition_defs} ) +calamares_add_test( + automounttests + SOURCES + ${PartitionModule_SOURCE_DIR}/jobs/AutoMountManagementJob.cpp + AutoMountTests.cpp + LIBRARIES + calamares +)