Skip to content

Commit

Permalink
refs #6362 All failing tests trying to delete files before and after
Browse files Browse the repository at this point in the history
  • Loading branch information
abuts committed Jan 22, 2013
1 parent 84c4c2d commit 78bd02d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Expand Up @@ -79,6 +79,12 @@ class CreateMDWorkspaceTest : public CxxTest::TestSuite

void do_test_exec(std::string Filename, bool lean, int MinRecursionDepth=0, int expectedNumMDBoxes=216)
{
if (Filename != "")
{
if (Poco::File(Filename).exists()) Poco::File(Filename).remove();
}


std::string wsName = "CreateMDWorkspaceTest_out";
CreateMDWorkspace alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
Expand Down
12 changes: 12 additions & 0 deletions Code/Mantid/Framework/MDAlgorithms/test/MergeMDFilesTest.h
Expand Up @@ -40,6 +40,12 @@ class MergeMDFilesTest : public CxxTest::TestSuite

void do_test_exec(std::string OutputFilename)
{
if (OutputFilename != "")
{
if (Poco::File(OutputFilename).exists()) Poco::File(OutputFilename).remove();
}


// Create a bunch of input files
std::vector<std::vector<std::string> > filenames;
std::vector<MDEventWorkspace3Lean::sptr> inWorkspaces;
Expand Down Expand Up @@ -96,6 +102,12 @@ class MergeMDFilesTest : public CxxTest::TestSuite

// Remove workspace from the data service.
AnalysisDataService::Instance().remove(outWSName);

if (OutputFilename != "")
{
if (Poco::File(OutputFilename).exists()) Poco::File(OutputFilename).remove();
}

}


Expand Down
13 changes: 12 additions & 1 deletion Code/Mantid/Framework/MDAlgorithms/test/SliceMDTest.h
Expand Up @@ -130,6 +130,11 @@ class SliceMDTest : public CxxTest::TestSuite
bool willFail = false,
std::string OutputFilename = "")
{
if (OutputFilename != "")
{
if (Poco::File(OutputFilename).exists()) Poco::File(OutputFilename).remove();
}

SliceMD alg;
TS_ASSERT_THROWS_NOTHING( alg.initialize() )
TS_ASSERT( alg.isInitialized() )
Expand Down Expand Up @@ -171,7 +176,13 @@ class SliceMDTest : public CxxTest::TestSuite
AnalysisDataService::Instance().remove("SliceMDTest_ws");
AnalysisDataService::Instance().remove("SliceMDTest_outWS");
// Clean up file
out->getBoxController()->closeFile(true);
out->getBoxController()->closeFile(true);

if (OutputFilename != "")
{
if (Poco::File(OutputFilename).exists()) Poco::File(OutputFilename).remove();
}

}


Expand Down

0 comments on commit 78bd02d

Please sign in to comment.