summaryrefslogtreecommitdiffstats
path: root/test/Repository/JavaH.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/Repository/JavaH.py')
-rw-r--r--test/Repository/JavaH.py32
1 files changed, 23 insertions, 9 deletions
diff --git a/test/Repository/JavaH.py b/test/Repository/JavaH.py
index 0420ca3..fc87904 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
###############################################################################