summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Moody <dmoody256@gmail.com>2017-12-07 22:57:20 (GMT)
committerDaniel Moody <dmoody256@gmail.com>2017-12-07 22:57:20 (GMT)
commit459da59f3d32349f95d5cad95d390463ff157312 (patch)
tree71d1a7d7703abcda2b92ac4a1159b73d15c8da30
parent45a657607b8ce3f306c549664ecf708136bbfe1d (diff)
downloadSCons-459da59f3d32349f95d5cad95d390463ff157312.zip
SCons-459da59f3d32349f95d5cad95d390463ff157312.tar.gz
SCons-459da59f3d32349f95d5cad95d390463ff157312.tar.bz2
On Mac there is are some place holder java binaries installed which confuse Scons test modules which just check if the binary exists. Added an extra check for this case.
-rw-r--r--QMTest/TestSCons.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index eccad9d..807d0bc 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -792,6 +792,15 @@ class TestSCons(TestCommon):
where_jar = self.where_is('jar', ENV['PATH'])
if not where_jar:
self.skip_test("Could not find Java jar, skipping test(s).\n")
+ elif sys.platform == "darwin":
+ # on Mac there is a place holder java installed to start the java install process
+ # so we need to check the output in this case, more info here:
+ # http://anas.pk/2015/09/02/solution-no-java-runtime-present-mac-yosemite/
+ sp = subprocess.Popen([where_jar, "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = sp.communicate()
+ sp.wait()
+ if("No Java runtime" in str(stderr)):
+ self.skip_test("Could not find Java jar, skipping test(s).\n")
return where_jar
def java_where_java(self, version=None):
@@ -800,8 +809,18 @@ class TestSCons(TestCommon):
"""
ENV = self.java_ENV(version)
where_java = self.where_is('java', ENV['PATH'])
+
if not where_java:
self.skip_test("Could not find Java java, skipping test(s).\n")
+ elif sys.platform == "darwin":
+ # on Mac there is a place holder java installed to start the java install process
+ # so we need to check the output in this case, more info here:
+ # http://anas.pk/2015/09/02/solution-no-java-runtime-present-mac-yosemite/
+ sp = subprocess.Popen([where_java, "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = sp.communicate()
+ sp.wait()
+ if("No Java runtime" in str(stderr)):
+ self.skip_test("Could not find Java java, skipping test(s).\n")
return where_java
def java_where_javac(self, version=None):
@@ -815,6 +834,15 @@ class TestSCons(TestCommon):
where_javac = self.where_is('javac', ENV['PATH'])
if not where_javac:
self.skip_test("Could not find Java javac, skipping test(s).\n")
+ elif sys.platform == "darwin":
+ # on Mac there is a place holder java installed to start the java install process
+ # so we need to check the output in this case, more info here:
+ # http://anas.pk/2015/09/02/solution-no-java-runtime-present-mac-yosemite/
+ sp = subprocess.Popen([where_javac, "-version"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = sp.communicate()
+ sp.wait()
+ if("No Java runtime" in str(stderr)):
+ self.skip_test("Could not find Java javac, skipping test(s).\n")
self.run(program = where_javac,
arguments = '-version',
stderr=None,