From nobody Wed Dec 28 17:33:48 2022 X-Original-To: dev-commits-src-main@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 4NhzCJ5cW5z2kfS8; Wed, 28 Dec 2022 17:33:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NhzCJ4c1bz3yfv; Wed, 28 Dec 2022 17:33:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672248828; 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=AvLkaF/x+SglrO/mYuaPxobr0Ui2jlJFJo8pKvfp39w=; b=RJOOiNt+7hFMVG4MS87l7GFHDeBKGtaASZBS+U73EnXXdDBOGykk0eoxOfne17V91D6pU8 J10pt/JkDYo+B5FfVueXabvFGw3FXJsDXtN4bWTlRrrKlOcPt7u12c3hMuuze7rDxVPxkX ViewFnnusvrbW8SQLUKJOjfRCUQv8dW2YIOLcW6Z86e6U+ZqrswldQsWyoNLrcuTdiltcG 5vAniEy8OI0cXBCXWKRWqmwMftEqRoG34Zpx9h9131TgZms3/E7vQNJ8x6gpyr+QrHePiK WhYw4I8IHURWdd/WiKaERaaiqMunWkC+69+5pwTVXxGiViJyT8DN9q7UrNShxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672248828; 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=AvLkaF/x+SglrO/mYuaPxobr0Ui2jlJFJo8pKvfp39w=; b=DjmkenbiyVGTijjL8Ri11nhE2LtGgKUihxA/4xyFaNZCpaKm1+rfa8stBJlGFpUtzqwMxy +6gUecKdWhcPaop95SAA559pUnhhdBcSgFgA7sbbE1YKMoNcd47BxMGEVQR2bhwqT6EkTz pgdqZNb1Ql2WkgwjaWj0qA7mVnRdVsz2ZIBPe+pwuCdbmRLZ1rQ/NqsZNXuWhwymn1J+q3 kyaGQJ3VAJULlRhGe85ozqbLMNz6rIjI7cdMCWUykNljxiRb3XDZ4ANeWMShqA2+aWsOXi XdSBEvDlSXv9HHgxmotnswNHtUcdRdXpnzeNEvrzijtDSauTywbopRgsWxX2mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672248828; a=rsa-sha256; cv=none; b=EAnp56T8t64tBQWXz+taTYL+BActqG7Ulon6+Mf91Tn8QtAtkFmTIpfKTQ2A0Paywj9hsN 0CTcvd3saUU24WsrdNc+Ouh+Zfk1K76VEkqfuh7E5LhsonEFCGHjiJOrXmu+L3qkbOzL1r UpPx1ZaJFyhRiHG/t0fRkcMiuiJPjcd+mgXGIKUJy5/8XblVOyT2A+ozSJttxGmpYOU4D0 KJ1wc+MEk7a/GkPy5iFIQ4VJYhVgD3vlgWDte6nSA+b55w5IfptIR3uC/GaGgN8WLkwtyc sQrqpld8nOGYjlXza3ZCTpffO7RzgIhpCcOCiq99cXLSrtaukdhvv9OgwMDkbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NhzCJ3fS6zy1B; Wed, 28 Dec 2022 17:33:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2BSHXmlu093649; Wed, 28 Dec 2022 17:33:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2BSHXmvi093648; Wed, 28 Dec 2022 17:33:48 GMT (envelope-from git) Date: Wed, 28 Dec 2022 17:33:48 GMT Message-Id: <202212281733.2BSHXmvi093648@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alexander V. Chernikov" Subject: git: 058ac3e80633 - main - atf_pytest_wrapper: fix pytest output truncation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: melifaro X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 058ac3e8063366dafa634d9107642e12b038bf09 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=058ac3e8063366dafa634d9107642e12b038bf09 commit 058ac3e8063366dafa634d9107642e12b038bf09 Author: Jose Luis Duran AuthorDate: 2022-12-28 17:28:59 +0000 Commit: Alexander V. Chernikov CommitDate: 2022-12-28 17:31:14 +0000 atf_pytest_wrapper: fix pytest output truncation Pass `-vv` to pytest in order to always get the full output. While here, enforce the modeline. Differential Revision: https://reviews.freebsd.org/D37894 MFC after: 2 weeks --- .../atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp | 55 +++++++++++----------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp index 7f6e886a16d9..78b045b9775f 100644 --- a/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp +++ b/libexec/atf/atf-pytest-wrapper/atf_pytest_wrapper.cpp @@ -65,7 +65,7 @@ class Handler { // * without schebang args // atf_wrap /path/to/script -l // Running test: - // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname + // atf_wrap '-P /path' /path/to/script -r /path1 -s /path2 -vk1=v1 testname void Parse(int argc, char **argv) { if (flag_debug) { PrintVector("IN", ToVector(argc, argv)); @@ -89,34 +89,34 @@ class Handler { // The next argument is a script name. Copy and keep argc/argv the same // Show usage for empty args if (argc == 0) { - Usage("Must provide a test case name", true); + Usage("Must provide a test case name", true); } script_path = std::string(argv[0]); int c; while ((c = getopt(argc, argv, "lr:s:v:")) != -1) { switch (c) { - case 'l': - flag_list = true; - break; - case 's': - src_dir = std::string(optarg); - break; - case 'r': - dst_file = std::string(optarg); - break; - case 'v': - { - std::string kv = std::string(optarg); - size_t splitter = kv.find("="); - if (splitter == std::string::npos) { - Usage("Unknown variable: " + kv, true); - } - kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1); - } - break; - default: - Usage("Unknown option -" + std::string(1, static_cast(c)), true); + case 'l': + flag_list = true; + break; + case 's': + src_dir = std::string(optarg); + break; + case 'r': + dst_file = std::string(optarg); + break; + case 'v': + { + std::string kv = std::string(optarg); + size_t splitter = kv.find("="); + if (splitter == std::string::npos) { + Usage("Unknown variable: " + kv, true); + } + kv_map[kv.substr(0, splitter)] = kv.substr(splitter + 1); + } + break; + default: + Usage("Unknown option -" + std::string(1, static_cast(c)), true); } } argc -= optind; @@ -138,7 +138,8 @@ class Handler { } std::vector BuildArgs() { - std::vector args = {"pytest", "-p", "no:cacheprovider", "-s", "--atf"}; + std::vector args = {"pytest", "-vv", "-p", + "no:cacheprovider", "-s", "--atf"}; if (flag_list) { args.push_back("--co"); @@ -179,7 +180,7 @@ class Handler { // Pass ATF kv pairs as env variables to avoid dealing with // pytest parser for (auto [k, v]: kv_map) { - setenv((kAtfVar + k).c_str(), v.c_str(), 1); + setenv((kAtfVar + k).c_str(), v.c_str(), 1); } } @@ -190,7 +191,7 @@ class Handler { // allocate array with final NULL char **arr = new char*[args.size() + 1](); for (unsigned long i = 0; i < args.size(); i++) { - // work around 'char *const *' + // work around 'char *const *' arr[i] = strdup(args[i].c_str()); } return execvp(binary.c_str(), arr) == 0; @@ -204,7 +205,7 @@ class Handler { "not_found__" << std::endl; } else { std::cout << "execvp(" << kPytestName << ") failed: " << - std::strerror(errno) << std::endl; + std::strerror(errno) << std::endl; } }