From c829e828323d6d2fc5e0f309538cecd3d5f03078 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Wed, 25 Oct 2023 14:23:25 -0400 Subject: [PATCH] Fix failing unit test Signed-off-by: Michael Jackson --- src/Plugins/ComplexCore/test/ExecuteProcessTest.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Plugins/ComplexCore/test/ExecuteProcessTest.cpp b/src/Plugins/ComplexCore/test/ExecuteProcessTest.cpp index d42014568e..7802b8f885 100644 --- a/src/Plugins/ComplexCore/test/ExecuteProcessTest.cpp +++ b/src/Plugins/ComplexCore/test/ExecuteProcessTest.cpp @@ -1,5 +1,6 @@ #include +#include "complex/ComplexVersion.hpp" #include "complex/Parameters/BoolParameter.hpp" #include "complex/Parameters/FileSystemPathParameter.hpp" #include "complex/Parameters/NumberParameter.hpp" @@ -45,10 +46,14 @@ TEST_CASE("ComplexCore::ExecuteProcessFilter: Valid filter execution") std::ifstream processOutputFile(processOutput); REQUIRE(processOutputFile.is_open()); + std::stringstream buffer; + buffer << processOutputFile.rdbuf(); + std::string firstLine; - std::getline(processOutputFile, firstLine); - firstLine = StringUtilities::rtrim(firstLine); - REQUIRE(firstLine == "nxrunner version 1.0.0"); + std::vector outputLines = complex::StringUtilities::split(buffer.str(), '\n'); + firstLine = StringUtilities::trimmed(outputLines[0]); + const std::string correctOutput = fmt::format("nxrunner: Version {} Build Date:{}", complex::Version::Package(), complex::Version::BuildDate()); + REQUIRE(firstLine == correctOutput); } TEST_CASE("ComplexCore::ExecuteProcessFilter: InValid filter execution")