diff --git a/Framework/DataHandling/test/SaveGSSTest.h b/Framework/DataHandling/test/SaveGSSTest.h index ec7898fd3c298bafd82ed122606989b605c7aa24..e4fe2449260f55acce2eb01e36c2988cd32142f3 100644 --- a/Framework/DataHandling/test/SaveGSSTest.h +++ b/Framework/DataHandling/test/SaveGSSTest.h @@ -10,6 +10,7 @@ #include "cxxtest/TestSuite.h" #include <Poco/File.h> +#include <Poco/Glob.h> #include <fstream> using namespace Mantid; @@ -347,6 +348,7 @@ public: m_alg = new SaveGSS(); m_alg->initialize(); + m_alg->setProperty("Append", false); m_alg->setPropertyValue("InputWorkspace", wsName); m_alg->setProperty("Filename", filename); m_alg->setRethrows(true); @@ -358,9 +360,14 @@ public: delete m_alg; m_alg = nullptr; Mantid::API::AnalysisDataService::Instance().remove(wsName); - Poco::File gsasfile(filename); - if (gsasfile.exists()) - gsasfile.remove(); + + // Use glob to find any files that match the output pattern + std::set<std::string> returnedFiles; + Poco::Glob::glob(globPattern, returnedFiles); + for (const auto &filename : returnedFiles) { + Poco::File pocoFile{filename}; + pocoFile.remove(); + } } private: @@ -369,6 +376,7 @@ private: const std::string wsName = "Test2BankWS"; const std::string filename = "test_performance.gsa"; + const std::string globPattern = "test_performance*.gsa"; SaveGSS *m_alg = nullptr; };