summaryrefslogtreecommitdiff
path: root/test/Repository
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2006-02-14 05:27:04 +0000
committerSteven Knight <knight@baldmt.com>2006-02-14 05:27:04 +0000
commit88efaa60e577bde3c1e7a69087b892c7e552f466 (patch)
tree3a95657ab680d4288110e8f1046b0d033997bd5f /test/Repository
parenteaae7bedf8d0660c0b7623b30c3c3a4262e2ff2e (diff)
downloadscons-88efaa60e577bde3c1e7a69087b892c7e552f466.tar.gz
Portability fixes for Repository Java tests; eliminate Solaris package warnings when searching for C++. (Baptiste Lepilleur)
Diffstat (limited to 'test/Repository')
-rw-r--r--test/Repository/Java.py19
-rw-r--r--test/Repository/JavaH.py32
-rw-r--r--test/Repository/RMIC.py32
3 files changed, 61 insertions, 22 deletions
diff --git a/test/Repository/Java.py b/test/Repository/Java.py
index 6a45dffd..6e8bbd6b 100644
--- a/test/Repository/Java.py
+++ b/test/Repository/Java.py
@@ -37,11 +37,22 @@ python = TestSCons.python
test = TestSCons.TestSCons()
-java = '/usr/local/j2sdk1.3.1/bin/java'
-javac = '/usr/local/j2sdk1.3.1/bin/javac'
+ENV = test.java_ENV()
-if not os.path.exists(javac):
- test.skip_test("Could not find Java, skipping test(s).\n")
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
+else:
+ where_javac = test.where_is('javac')
+if not where_javac:
+ test.skip_test("Could not find Java javac, skipping test(s).\n")
+
+where_java = test.where_is('java')
+if not where_java:
+ test.skip_test("Could not find Java java, skipping test(s).\n")
+
+
+java = where_java
+javac = where_javac
###############################################################################
diff --git a/test/Repository/JavaH.py b/test/Repository/JavaH.py
index 0420ca37..fc879041 100644
--- a/test/Repository/JavaH.py
+++ b/test/Repository/JavaH.py
@@ -37,15 +37,29 @@ python = TestSCons.python
test = TestSCons.TestSCons()
-java = '/usr/local/j2sdk1.3.1/bin/java'
-javac = '/usr/local/j2sdk1.3.1/bin/javac'
-javah = '/usr/local/j2sdk1.3.1/bin/javah'
-
-if not os.path.exists(javac):
- test.skip_test("Could not find Java (javac), skipping test(s).\n")
-
-if not os.path.exists(javah):
- test.skip_test("Could not find Java (javah), skipping test(s).\n")
+ENV = test.java_ENV()
+
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
+else:
+ where_javac = test.where_is('javac')
+if not where_javac:
+ test.skip_test("Could not find Java javac, skipping test(s).\n")
+
+if test.detect_tool('javah', ENV=ENV):
+ where_javah = test.detect('JAVAH', 'javah', ENV=ENV)
+else:
+ where_javah = test.where_is('javah')
+if not where_javah:
+ test.skip_test("Could not find Java javah, skipping test(s).\n")
+
+where_java = test.where_is('java')
+if not where_java:
+ test.skip_test("Could not find Java java, skipping test(s).\n")
+
+java = where_java
+javac = where_javac
+javah = where_javah
###############################################################################
diff --git a/test/Repository/RMIC.py b/test/Repository/RMIC.py
index 011006d7..e4a44599 100644
--- a/test/Repository/RMIC.py
+++ b/test/Repository/RMIC.py
@@ -37,15 +37,29 @@ python = TestSCons.python
test = TestSCons.TestSCons()
-java = '/usr/local/j2sdk1.3.1/bin/java'
-javac = '/usr/local/j2sdk1.3.1/bin/javac'
-rmic = '/usr/local/j2sdk1.3.1/bin/rmic'
-
-if not os.path.exists(javac):
- test.skip_test("Could not find Java (javac), skipping test(s).\n")
-
-if not os.path.exists(rmic):
- test.skip_test("Could not find Java (rmic), skipping test(s).\n")
+ENV = test.java_ENV()
+
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
+else:
+ where_javac = test.where_is('javac')
+if not where_javac:
+ test.skip_test("Could not find Java javac, skipping test(s).\n")
+
+if test.detect_tool('rmic', ENV=ENV):
+ where_rmic = test.detect('JAVAC', 'rmic', ENV=ENV)
+else:
+ where_rmic = test.where_is('rmic')
+if not where_rmic:
+ test.skip_test("Could not find Java rmic, skipping non-simulated test(s).\n")
+
+where_java = test.where_is('java')
+if not where_java:
+ test.skip_test("Could not find Java java, skipping test(s).\n")
+
+java = where_java
+javac = where_javac
+rmic = where_rmic
###############################################################################