From nobody Fri Dec 26 20:07:49 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ddGr612prz6M4r1 for ; Fri, 26 Dec 2025 20:07:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ddGr55fjzz3MX5 for ; Fri, 26 Dec 2025 20:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766779669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VEMJZXQ1SmD3JLLdk/SQDULq6UXwCJqb4h7lh7IIp1U=; b=fvjAbeT0c0BTKz3OiiG+ItaCNe38JrpgbME2DxGs71KPdhnsPBRw2DFTZUqyUNpWLOlaaN JXkgjRrmhMSv842P5irgofZSmqjNxjqBTzFPHH+31jClmoXyhUtfOg9fV0JNvX9YjTIKpy d4P/S2IBW0naoDx7ibyf7wAQccg+g1xgPIAmEKp5MowOCyBlLykP/iCGGXp/dvwulpcXNJ hQg5orepmK5RY+SU+rxAw9JxV2k/Yp3e8AxAhYIQSKv8GVT4Vz39aCMM9/wuWWbXgrMLYP xfidvtZNzkVnHgEVwVq78Eq6tP0kUFh2X6cmmVmsiZdW+ML9HKNUYthuDuk2LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766779669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VEMJZXQ1SmD3JLLdk/SQDULq6UXwCJqb4h7lh7IIp1U=; b=nDzth4K3Td1IfaycUPpzU3T01Lmq/cUp12euciyv4vgUvqdl5byLfMRuoCGz136jk88ee2 BeumlckpnZbRlK/J79CXfHJpUlQNFo0IpEzA686PZlO3/Kgj6RXXuo6hqXZxsxtQKU18ut sd+gpMOVRFmVPCRUfKPu5IuLEfjZwcQ1xcztURxcEgZW11xhR2HC+kyL30TC2dv33ZitPT bfK3wO3VXE4sa0noDYVv7VrvYFSdYnW1N/chftRXf6cWGmOgOqME0kwNbmn2ON13eU+6oN EPVRF7qjW+KRxlMS7t27HjQFk0PQr/VuQsNRplUtYcooli9rxRlyf9SSREfBDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766779669; a=rsa-sha256; cv=none; b=Xw5tZBfdBW/pkuk9+9j6IixvOQ178J+AslLBSB4I5TfX+sALzQjX193TS9qpYa5SuTYSlO /k9XvwbVyYe64sYNFafSDO1XmbNZ6QQhuNppJ1nkKX0kei55Q2DkyOg0VXv1pVIEYKQfs5 gycOWH+TPwGdNHOgc9afYEeJ/ogseT0BAIaWky01N3SedGfzlw3cf10305RMpzgOu5JUMX BI0FZrbR/8T8FP6b1PAkMbu80lPiEd79oJEX23BF/rQKdmvWoQ4sRMxl/Mxbn07OmAA0BX 4GfUNTBQ9Q3jNWsu2g/Aj9PK2dAuLQSYb+1ndO9u+E5+jQzO1QwgurMLoFyF2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4ddGr54bZpzCVH for ; Fri, 26 Dec 2025 20:07:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e994 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 26 Dec 2025 20:07:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Igor Ostapenko Subject: git: 350f31973189 - main - kyua: Make "debug -p" skip writing stdout/stderr to tmp files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: igoro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 350f319731897f741b516db99636e7ced071dfa4 Auto-Submitted: auto-generated Date: Fri, 26 Dec 2025 20:07:49 +0000 Message-Id: <694eeb15.3e994.2f071a78@gitrepo.freebsd.org> The branch main has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=350f319731897f741b516db99636e7ced071dfa4 commit 350f319731897f741b516db99636e7ced071dfa4 Author: Igor Ostapenko AuthorDate: 2025-12-26 20:06:56 +0000 Commit: Igor Ostapenko CommitDate: 2025-12-26 20:06:56 +0000 kyua: Make "debug -p" skip writing stdout/stderr to tmp files Reviewed by: kp, ngie Differential Revision: https://reviews.freebsd.org/D54363 --- contrib/kyua/cli/cmd_debug.cpp | 6 +++++- contrib/kyua/engine/scheduler.cpp | 20 +++++++++++++++----- contrib/kyua/engine/scheduler.hpp | 6 +++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/contrib/kyua/cli/cmd_debug.cpp b/contrib/kyua/cli/cmd_debug.cpp index 700c4b3ea851..978ccae0fdf1 100644 --- a/contrib/kyua/cli/cmd_debug.cpp +++ b/contrib/kyua/cli/cmd_debug.cpp @@ -149,7 +149,11 @@ cmd_debug::run(cmdline::ui* ui, const cmdline::parsed_cmdline& cmdline, const engine::test_filter filter = engine::test_filter::parse( test_case_name); - auto debugger = std::shared_ptr< engine::debugger >(new dbg(ui, cmdline)); + engine::debugger_ptr debugger = nullptr; + if (cmdline.has_option(pause_before_cleanup_upon_fail_option.long_name()) + || cmdline.has_option(pause_before_cleanup_option.long_name())) { + debugger = std::shared_ptr< engine::debugger >(new dbg(ui, cmdline)); + } const drivers::debug_test::result result = drivers::debug_test::drive( debugger, diff --git a/contrib/kyua/engine/scheduler.cpp b/contrib/kyua/engine/scheduler.cpp index 4c40bf31046e..a0719ec461ab 100644 --- a/contrib/kyua/engine/scheduler.cpp +++ b/contrib/kyua/engine/scheduler.cpp @@ -1283,7 +1283,9 @@ scheduler::exec_handle scheduler::scheduler_handle::spawn_test( const model::test_program_ptr test_program, const std::string& test_case_name, - const config::tree& user_config) + const config::tree& user_config, + const utils::optional& stdout_target, + const utils::optional& stderr_target) { _pimpl->generic.check_interrupt(); @@ -1305,7 +1307,7 @@ scheduler::scheduler_handle::spawn_test( run_test_program(interface, test_program, test_case_name, user_config), test_case.get_metadata().timeout(), - unprivileged_user); + unprivileged_user, stdout_target, stderr_target); const exec_data_ptr data(new test_exec_data( test_program, test_case_name, interface, user_config, handle.pid())); @@ -1563,8 +1565,16 @@ scheduler::scheduler_handle::debug_test( const fs::path& stdout_target, const fs::path& stderr_target) { + optional out = none; + optional err = none; + const model::test_case& test_case = test_program->find(test_case_name); + if (test_case.get_debugger() != nullptr) { + out = stdout_target; + err = stderr_target; + } + const exec_handle exec_handle = spawn_test( - test_program, test_case_name, user_config); + test_program, test_case_name, user_config, out, err); result_handle_ptr result_handle = wait_any(); // TODO(jmmv): We need to do this while the subprocess is alive. This is @@ -1574,12 +1584,12 @@ scheduler::scheduler_handle::debug_test( // Unfortunately, we cannot do so. We cannot just read and block from a // file, waiting for further output to appear... as this only works on pipes // or sockets. We need a better interface for this whole thing. - { + if (test_case.get_debugger() == nullptr) { std::unique_ptr< std::ostream > output = utils::open_ostream( stdout_target); *output << utils::read_file(result_handle->stdout_file()); } - { + if (test_case.get_debugger() == nullptr) { std::unique_ptr< std::ostream > output = utils::open_ostream( stderr_target); *output << utils::read_file(result_handle->stderr_file()); diff --git a/contrib/kyua/engine/scheduler.hpp b/contrib/kyua/engine/scheduler.hpp index ee01c83b4991..508a0c0cbfd9 100644 --- a/contrib/kyua/engine/scheduler.hpp +++ b/contrib/kyua/engine/scheduler.hpp @@ -74,6 +74,8 @@ #include "utils/process/executor_fwd.hpp" #include "utils/process/status_fwd.hpp" +using utils::none; + namespace engine { namespace scheduler { @@ -248,7 +250,9 @@ public: const utils::config::tree&); exec_handle spawn_test(const model::test_program_ptr, const std::string&, - const utils::config::tree&); + const utils::config::tree&, + const utils::optional& = none, + const utils::optional& = none); result_handle_ptr wait_any(void); result_handle_ptr debug_test(const model::test_program_ptr,