LUCENE-3452: add tests.lockdir (default in build.xml is build/, falls back to java.io.tmpdir)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1188975 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2011-10-25 23:52:10 +00:00
parent e644d6f84c
commit 19768f6e5a
2 changed files with 5 additions and 1 deletions

View File

@ -133,6 +133,7 @@
<property name="build.dir" location="build"/> <property name="build.dir" location="build"/>
<!-- Needed in case a contrib needs the original build, also for compile-tools to be called from contrib --> <!-- Needed in case a contrib needs the original build, also for compile-tools to be called from contrib -->
<property name="common.build.dir" location="${common.dir}/build"/> <property name="common.build.dir" location="${common.dir}/build"/>
<property name="tests.lockdir" location="${common.build.dir}"/>
<property name="dist.dir" location="dist"/> <property name="dist.dir" location="dist"/>
<property name="maven.dist.dir" location="dist/maven"/> <property name="maven.dist.dir" location="dist/maven"/>
<property name="m2.repository.url" value="file://${maven.dist.dir}"/> <property name="m2.repository.url" value="file://${maven.dist.dir}"/>
@ -546,6 +547,8 @@
<!-- allow tests to control debug prints --> <!-- allow tests to control debug prints -->
<sysproperty key="tests.verbose" value="${tests.verbose}"/> <sysproperty key="tests.verbose" value="${tests.verbose}"/>
<!-- directory for formatter lock -->
<sysproperty key="tests.lockdir" value="${tests.lockdir}"/>
<!-- set the codec tests should run with --> <!-- set the codec tests should run with -->
<sysproperty key="tests.codec" value="${tests.codec}"/> <sysproperty key="tests.codec" value="${tests.codec}"/>
<!-- set the codec provider tests should run with --> <!-- set the codec provider tests should run with -->

View File

@ -66,7 +66,8 @@ public class LuceneJUnitResultFormatter implements JUnitResultFormatter {
private static final org.apache.lucene.store.Lock lock; private static final org.apache.lucene.store.Lock lock;
static { static {
File lockDir = new File(System.getProperty("java.io.tmpdir"), File lockDir = new File(
System.getProperty("tests.lockdir", System.getProperty("java.io.tmpdir")),
"lucene_junit_lock"); "lucene_junit_lock");
lockDir.mkdirs(); lockDir.mkdirs();
if (!lockDir.exists()) { if (!lockDir.exists()) {