From 0df44683ce3355666268d59f836e7b061bf6b1c8 Mon Sep 17 00:00:00 2001 From: stevenknight Date: Tue, 14 Feb 2006 05:27:04 +0000 Subject: [PATCH] Portability fixes for Repository Java tests; eliminate Solaris package warnings when searching for C++. (Baptiste Lepilleur) git-svn-id: http://scons.tigris.org/svn/scons/trunk@1424 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- src/CHANGES.txt | 5 +++-- src/engine/SCons/Tool/sunc++.py | 2 +- test/Repository/Java.py | 19 +++++++++++++++---- test/Repository/JavaH.py | 32 +++++++++++++++++++++++--------- test/Repository/RMIC.py | 32 +++++++++++++++++++++++--------- 5 files changed, 65 insertions(+), 25 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 2e243140..70e19d4b 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -144,8 +144,9 @@ RELEASE 0.97 - XXX - Add support for Visual Studio 2005 Pro. - - Fix Windows portability issues in various Visual Studio and - Java tests. + - Fix portability issues in various Visual Studio and Java tests. + + - Ignore pkgchk errors on Solaris when searching for the C++ compiler. From Christian Maaser: diff --git a/src/engine/SCons/Tool/sunc++.py b/src/engine/SCons/Tool/sunc++.py index a6ac10ae..36316cbf 100644 --- a/src/engine/SCons/Tool/sunc++.py +++ b/src/engine/SCons/Tool/sunc++.py @@ -53,7 +53,7 @@ def get_cppc(env): line = os.popen(cmd).readline() if line: cppcVersion = line.split()[-1] - cmd = "%s -l %s | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" % (pkgchk, package) + cmd = "%s -l %s 2>/dev/null | grep '^Pathname:.*/bin/CC$' | grep -v '/SC[0-9]*\.[0-9]*/'" % (pkgchk, package) line = os.popen(cmd).readline() cppcPath = os.path.dirname(line.split()[-1]) break 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 ############################################################################### -- 2.26.2