From f087595f9049b8be94fe0d69a3b494c33e811159 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Sat, 13 Jan 2024 00:30:55 -0500 Subject: [PATCH] test_proclog: fix conflict with pytest (#30989) old-commit-hash: 884de6e4570545ccf4ee3e6ff8d2f59e4a0847c6 --- system/proclogd/tests/test_proclog.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/system/proclogd/tests/test_proclog.cc b/system/proclogd/tests/test_proclog.cc index 20298cd3d8..613c326166 100644 --- a/system/proclogd/tests/test_proclog.cc +++ b/system/proclogd/tests/test_proclog.cc @@ -143,11 +143,10 @@ TEST_CASE("buildProcLogerMessage") { std::ifstream stream(cmd_path); auto cmdline = Parser::cmdline(stream); REQUIRE(cmdline.size() == p.getCmdline().size()); - // do not check the cmdline of pytest as it will change. - if (cmdline.size() > 0 && cmdline[0].find("[pytest") != 0) { - for (int i = 0; i < p.getCmdline().size(); ++i) { - REQUIRE(cmdline[i] == p.getCmdline()[i].cStr()); - } + for (int i = 0; i < p.getCmdline().size(); ++i) { + // do not check the cmdline of pytest as it will change. + if (cmdline[i].find("[pytest") || std::string(p.getCmdline()[i]).find("[pytest")) continue; + REQUIRE(cmdline[i] == p.getCmdline()[i].cStr()); } } }