From 8d184228bb76089919b1978491a47718875c01d0 Mon Sep 17 00:00:00 2001 From: Jonathan Giroux Date: Tue, 4 Oct 2022 15:45:57 +0200 Subject: [PATCH] test: log debug messages on console on CICD --- appveyor.yml | 1 + dokan/src/usage_tests.rs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 04d86b3..518af10 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,6 +3,7 @@ branches: - master environment: + DOKAN_CONSOLE_DEBUG_LOG: 1 RUST_BACKTRACE: 1 AccessTokenDokanDoc: secure: Z5/daTZ6OJaDbslmhxSxxB6leKaqHTnTbISy153Y4cdJm/oTAbDHaofb9TqvKXV1 diff --git a/dokan/src/usage_tests.rs b/dokan/src/usage_tests.rs index e39e555..72df507 100644 --- a/dokan/src/usage_tests.rs +++ b/dokan/src/usage_tests.rs @@ -881,13 +881,20 @@ pub fn with_test_drive(scope: Scope) { let (tx_signal, rx_signal) = mpsc::sync_channel(1024); + let mut flags = + MountFlags::CURRENT_SESSION | MountFlags::FILELOCK_USER_MODE | MountFlags::ALT_STREAM; + + let enable_console_debug_log = + std::env::var_os("DOKAN_CONSOLE_DEBUG_LOG").map_or(false, |x| &x != "0"); + if enable_console_debug_log { + flags = flags | MountFlags::DEBUG | MountFlags::STDERR; + } + let drive_thread_handle = thread::spawn(move || { let mount_point = convert_str("Z:\\"); let handler = TestHandler::new(tx_signal); let options = MountOptions { - flags: MountFlags::CURRENT_SESSION - | MountFlags::FILELOCK_USER_MODE - | MountFlags::ALT_STREAM, + flags, timeout: Duration::from_secs(15), allocation_unit_size: 1024, sector_size: 1024,