From 35b36b3502042506bd0f499dfb110bfd6657e2ed Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Wed, 26 May 2010 21:09:55 +0000
Subject: [PATCH] Add support of build.dir redefinition for unit tests By default, most of the files generated at build time are located in <ws>/build. If -Dbuild.dir is used, it is possible to specify another directory. This change allows to run unit-tests in this kind of build environment.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
index ef4d8f1..b09417f 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java
@@ -115,6 +115,9 @@
public static final String PROPERTY_BUILD_ROOT =
"org.opends.server.BuildRoot";
+ public static final String PROPERTY_BUILD_DIR =
+ "org.opends.server.BuildDir";
+
/**
* The name of the system property that specifies an existing OpenDS
* installation root (inside or outside of the source tree).
@@ -271,7 +274,9 @@
// Get the build root and use it to create a test package directory.
String buildRoot = System.getProperty(PROPERTY_BUILD_ROOT);
- File buildDir = new File(buildRoot, "build");
+ String buildDirStr = System.getProperty(PROPERTY_BUILD_DIR,
+ buildRoot + File.separator + "build");
+ File buildDir = new File(buildDirStr);
File unitRoot = new File(buildDir, "unit-tests");
File testInstallRoot = null;
File testInstanceRoot = null;
--
Gitblit v1.10.0