diff --git a/cpp/test/Slice/errorDetection/test.py b/cpp/test/Slice/errorDetection/test.py index 6f11921bd73..001543cb0e6 100644 --- a/cpp/test/Slice/errorDetection/test.py +++ b/cpp/test/Slice/errorDetection/test.py @@ -14,9 +14,10 @@ def runClientSide(self, current): testdir = current.testsuite.getPath() slice2cpp = SliceTranslator("slice2cpp") - if os.path.exists("tmp"): - shutil.rmtree("tmp") - os.mkdir("tmp") + outdir = "{0}/tmp".format(testdir) + if os.path.exists(outdir): + shutil.rmtree(outdir) + os.mkdir(outdir) files = glob.glob("{0}/*.ice".format(testdir)) files.sort() @@ -54,7 +55,7 @@ def runClientSide(self, current): compiler.run(current, args=["forward/Forward.ice", "--output-dir", "tmp"]) current.writeln("ok") finally: - if os.path.exists("{0}/tmp".format(testdir)): - shutil.rmtree("{0}/tmp".format(testdir)) + if os.path.exists(outdir): + shutil.rmtree(outdir) TestSuite(__name__, [ SliceErrorDetectionTestCase() ])