From 8bac6711e5a9649b4f4810459c44a057b26dca6e Mon Sep 17 00:00:00 2001 From: wisberg Date: Wed, 7 May 2003 06:04:10 +0000 Subject: [PATCH] -killTemp to delete temp directories when each test case completes --- .../src/org/aspectj/testing/drivers/Harness.java | 15 ++++++++++++--- .../src/org/aspectj/testing/drivers/package.html | 8 ++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/testing-drivers/src/org/aspectj/testing/drivers/Harness.java b/testing-drivers/src/org/aspectj/testing/drivers/Harness.java index 0cca13df5..b9b540cba 100644 --- a/testing-drivers/src/org/aspectj/testing/drivers/Harness.java +++ b/testing-drivers/src/org/aspectj/testing/drivers/Harness.java @@ -170,9 +170,12 @@ public class Harness { /** map of feature names to features */ private HashMap features; - /** if true, do not delete temporary files */ + /** if true, do not delete temporary files. */ private boolean keepTemp; + /** if true, delete temporary files as each test completes. */ + private boolean killTemp; + /** if true, then log results in report(..) when done */ private boolean logResults; @@ -305,7 +308,9 @@ public class Harness { status.setIdentifier(spec); // validator is used for all setup in entire tree... Validator validator = new Validator(status); - validator.lock(this); + if (!killTemp) { + validator.lock(this); + } Sandbox sandbox = null; try { sandbox = new Sandbox(spec.getSuiteDirFile(), validator); @@ -315,8 +320,10 @@ public class Harness { numIncomplete = ((RunSpecIterator) tests).getNumIncomplete(); } } finally { - validator.unlock(this); if (!keepTemp) { + if (!killTemp) { + validator.unlock(this); + } validator.deleteTempFiles(verboseHarness); } } @@ -401,6 +408,8 @@ public class Harness { quietHarness = true; } else if ("-keepTemp".equals(option)) { keepTemp = true; + } else if ("-killTemp".equals(option)) { + killTemp = true; } else if ("-logResults".equals(option)) { logResults = true; } else { diff --git a/testing-drivers/src/org/aspectj/testing/drivers/package.html b/testing-drivers/src/org/aspectj/testing/drivers/package.html index 8c795bdd3..6c8a7ebf5 100644 --- a/testing-drivers/src/org/aspectj/testing/drivers/package.html +++ b/testing-drivers/src/org/aspectj/testing/drivers/package.html @@ -38,6 +38,14 @@ each component in the chain may accept and interpret: -keepTemp: Normally the harness saves temp files until the end of the run, and deletes them. If you abort the run or specify -keepTemp, then temporary (sandbox) directories will remain for analysis. + In either case, the file system accumulates all temporary directories + and files used for a give harness run. + + -killTemp: The opposite of -keepTemp, + this causes the harness to delete temporary (sandbox) directories at + the end of each test run. + In this case, the file system only accumulates files for + the current test. *- variants: Options with a trailing "-" cause two sets of option lists to be produced, one with and one without the corresponding -- 2.39.5