From 459da59f3d32349f95d5cad95d390463ff157312 Mon Sep 17 00:00:00 2001 From: Daniel Moody Date: Thu, 7 Dec 2017 17:57:20 -0500 Subject: 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. --- QMTest/TestSCons.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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, -- cgit v0.12