From 40ede9995361abb3169891486754f51bfaabdf9b Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 31 Oct 2021 12:01:25 -0600 Subject: Java tests: minor cleanups Update file headers Remove references to javah that are not used Black a couple of SConstcuts No functional changes - prep work for javah workarounds. Signed-off-by: Mats Wichmann --- test/Java/DerivedSourceTest.py | 7 +++---- test/Java/JAR.py | 7 +++---- test/Java/JARCHDIR.py | 7 +++---- test/Java/JARCOM.py | 7 +++---- test/Java/JARCOMSTR.py | 7 +++---- test/Java/JARFLAGS.py | 8 +++----- test/Java/JAVABOOTCLASSPATH.py | 19 +++++++------------ test/Java/JAVAC.py | 7 +++---- test/Java/JAVACCOM.py | 7 +++---- test/Java/JAVACCOMSTR.py | 7 +++---- test/Java/JAVACFLAGS.py | 7 +++---- test/Java/JAVACLASSPATH.py | 7 +++---- test/Java/JAVAH.py | 7 +++---- test/Java/JAVAHCOM.py | 19 ++++++++++--------- test/Java/JAVAHCOMSTR.py | 21 +++++++++++---------- test/Java/JAVASOURCEPATH.py | 19 ++++++++----------- test/Java/Java-1.4.py | 6 +++--- test/Java/Java-1.5.py | 6 +++--- test/Java/Java-1.6.py | 4 ---- test/Java/Java-1.8.py | 6 +++--- test/Java/RMIC.py | 7 +++---- test/Java/RMICCOM.py | 7 +++---- test/Java/RMICCOMSTR.py | 7 +++---- test/Java/jar_not_in_PATH.py | 7 +++---- test/Java/multi-step.py | 6 +++--- test/Java/nested-classes.py | 8 +++----- test/Java/no-JARCHDIR.py | 7 +++---- test/Java/rmic_not_in_PATH.py | 7 +++---- test/Java/source-files.py | 17 +++++++---------- test/Java/swig-dependencies.py | 17 +++++++---------- 30 files changed, 119 insertions(+), 156 deletions(-) diff --git a/test/Java/DerivedSourceTest.py b/test/Java/DerivedSourceTest.py index 7f80595..e54b8c8 100644 --- a/test/Java/DerivedSourceTest.py +++ b/test/Java/DerivedSourceTest.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test of javac.py when building java code from derived sources. diff --git a/test/Java/JAR.py b/test/Java/JAR.py index 2cd6012..bc52a89 100644 --- a/test/Java/JAR.py +++ b/test/Java/JAR.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import TestSCons diff --git a/test/Java/JARCHDIR.py b/test/Java/JARCHDIR.py index 24a8597..49e7344 100644 --- a/test/Java/JARCHDIR.py +++ b/test/Java/JARCHDIR.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test that when JARCHDIR that our command to create .jar files diff --git a/test/Java/JARCOM.py b/test/Java/JARCOM.py index 9146445..ce5dc77 100644 --- a/test/Java/JARCOM.py +++ b/test/Java/JARCOM.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test the ability to configure the $JARCOM construction variable. diff --git a/test/Java/JARCOMSTR.py b/test/Java/JARCOMSTR.py index 4bdc45b..b4a2efc 100644 --- a/test/Java/JARCOMSTR.py +++ b/test/Java/JARCOMSTR.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test that the $JARCOMSTR construction variable allows you to configure diff --git a/test/Java/JARFLAGS.py b/test/Java/JARFLAGS.py index fc6e55e..7c16491 100644 --- a/test/Java/JARFLAGS.py +++ b/test/Java/JARFLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,10 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - import TestSCons diff --git a/test/Java/JAVABOOTCLASSPATH.py b/test/Java/JAVABOOTCLASSPATH.py index 8aaf869..69d9471 100644 --- a/test/Java/JAVABOOTCLASSPATH.py +++ b/test/Java/JAVABOOTCLASSPATH.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that use of $JAVABOOTCLASSPATH sets the -bootclasspath option @@ -33,19 +32,15 @@ import os import TestSCons -_python_ = TestSCons._python_ - test = TestSCons.TestSCons() where_javac, java_version = test.java_where_javac() -where_javah = test.java_where_javah() test.write('SConstruct', """ -env = Environment(tools = ['javac', 'javah'], - JAVABOOTCLASSPATH = ['dir1', 'dir2']) -j1 = env.Java(target = 'class', source = 'com/Example1.java') -j2 = env.Java(target = 'class', source = 'com/Example2.java') -""" % locals()) +env = Environment(tools=['javac'], JAVABOOTCLASSPATH=['dir1', 'dir2']) +j1 = env.Java(target='class', source='com/Example1.java') +j2 = env.Java(target='class', source='com/Example2.java') +""") test.subdir('com') diff --git a/test/Java/JAVAC.py b/test/Java/JAVAC.py index aaaa8f5..20f7f96 100644 --- a/test/Java/JAVAC.py +++ b/test/Java/JAVAC.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test setting the JAVAC variable. diff --git a/test/Java/JAVACCOM.py b/test/Java/JAVACCOM.py index 0de173d..3bb4dfb 100644 --- a/test/Java/JAVACCOM.py +++ b/test/Java/JAVACCOM.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test the ability to configure the $JAVACCOM construction variable. diff --git a/test/Java/JAVACCOMSTR.py b/test/Java/JAVACCOMSTR.py index 8540e13..4e25815 100644 --- a/test/Java/JAVACCOMSTR.py +++ b/test/Java/JAVACCOMSTR.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test that the $JAVACCOMSTR construction variable allows you to configure diff --git a/test/Java/JAVACFLAGS.py b/test/Java/JAVACFLAGS.py index 28c58c1..a40610d 100644 --- a/test/Java/JAVACFLAGS.py +++ b/test/Java/JAVACFLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os diff --git a/test/Java/JAVACLASSPATH.py b/test/Java/JAVACLASSPATH.py index fb2b33f..aefacca 100644 --- a/test/Java/JAVACLASSPATH.py +++ b/test/Java/JAVACLASSPATH.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that use of $JAVASOURCEPATH allows finding Java .class diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py index c7ac334..853b2da 100644 --- a/test/Java/JAVAH.py +++ b/test/Java/JAVAH.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os diff --git a/test/Java/JAVAHCOM.py b/test/Java/JAVAHCOM.py index 801707e..00df2ae 100644 --- a/test/Java/JAVAHCOM.py +++ b/test/Java/JAVAHCOM.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test the ability to configure the $JAVAHCOM construction variable. @@ -37,11 +36,13 @@ test = TestSCons.TestSCons() test.file_fixture('mycompile.py') test.write('SConstruct', """ -env = Environment(TOOLS = ['default', 'javah'], - JAVAHCOM = r'%(_python_)s mycompile.py javah $TARGET $SOURCES') -env.JavaH(target = 'out', source = 'file1.class') -env.JavaH(target = 'out', source = 'file2.class') -env.JavaH(target = 'out', source = 'file3.class') +env = Environment( + TOOLS=['default', 'javah'], + JAVAHCOM=r'%(_python_)s mycompile.py javah $TARGET $SOURCES', +) +env.JavaH(target='out', source='file1.class') +env.JavaH(target='out', source='file2.class') +env.JavaH(target='out', source='file3.class') """ % locals()) test.write('file1.class', "file1.class\n/*javah*/\n") diff --git a/test/Java/JAVAHCOMSTR.py b/test/Java/JAVAHCOMSTR.py index c205890..3936947 100644 --- a/test/Java/JAVAHCOMSTR.py +++ b/test/Java/JAVAHCOMSTR.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test that the $JAVAHCOMSTR construction variable allows you to configure @@ -46,12 +45,14 @@ out_file3_h = os.path.join('out', 'file3.h') test.file_fixture('mycompile.py') test.write('SConstruct', """ -env = Environment(TOOLS = ['default', 'javah'], - JAVAHCOM = r'%(_python_)s mycompile.py javah $TARGET $SOURCES', - JAVAHCOMSTR = 'Building javah $TARGET from $SOURCES') -env.JavaH(target = 'out', source = 'file1.class') -env.JavaH(target = 'out', source = 'file2.class') -env.JavaH(target = 'out', source = 'file3.class') +env = Environment( + TOOLS=['default', 'javah'], + JAVAHCOM=r'%(_python_)s mycompile.py javah $TARGET $SOURCES', + JAVAHCOMSTR='Building javah $TARGET from $SOURCES', +) +env.JavaH(target='out', source='file1.class') +env.JavaH(target='out', source='file2.class') +env.JavaH(target='out', source='file3.class') """ % locals()) test.write('file1.class', "file1.class\n/*javah*/\n") diff --git a/test/Java/JAVASOURCEPATH.py b/test/Java/JAVASOURCEPATH.py index 8e7b762..19a474d 100644 --- a/test/Java/JAVASOURCEPATH.py +++ b/test/Java/JAVASOURCEPATH.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that use of $JAVASOURCEPATH allows finding source .java @@ -32,18 +31,16 @@ to the javac command line. import TestSCons -_python_ = TestSCons._python_ - test = TestSCons.TestSCons() where_javac, java_version = test.java_where_javac() test.write('SConstruct', """ -env = Environment(tools = ['javac', 'javah']) -bar = env.Java(target = 'bar/classes', - source = 'bar/src/TestBar.java', - JAVASOURCEPATH = ['foo/src']) -""" % locals()) +env = Environment(tools=['javac']) +bar = env.Java( + target='bar/classes', source='bar/src/TestBar.java', JAVASOURCEPATH=['foo/src'] +) +""") test.subdir('foo', ['foo', 'src'], diff --git a/test/Java/Java-1.4.py b/test/Java/Java-1.4.py index 8bbefaf..96e6368 100644 --- a/test/Java/Java-1.4.py +++ b/test/Java/Java-1.4.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,8 +23,6 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - """ Test Java compilation with a live Java 1.4 "javac" compiler. """ diff --git a/test/Java/Java-1.5.py b/test/Java/Java-1.5.py index 58513e2..5e6cbd7 100644 --- a/test/Java/Java-1.5.py +++ b/test/Java/Java-1.5.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,8 +23,6 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - """ Test Java compilation with a live Java 1.5 "javac" compiler. """ diff --git a/test/Java/Java-1.6.py b/test/Java/Java-1.6.py index b99a26a..c759e87 100644 --- a/test/Java/Java-1.6.py +++ b/test/Java/Java-1.6.py @@ -1,7 +1,5 @@ #!/usr/bin/env python # -# __COPYRIGHT__ -# # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including @@ -21,8 +19,6 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - """ Test Java compilation with a live Java 1.6 "javac" compiler. """ diff --git a/test/Java/Java-1.8.py b/test/Java/Java-1.8.py index 4fcfe2b..4e54208 100644 --- a/test/Java/Java-1.8.py +++ b/test/Java/Java-1.8.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,8 +23,6 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - """ Test Java compilation with a live Java 1.8 "javac" compiler. """ diff --git a/test/Java/RMIC.py b/test/Java/RMIC.py index 519ad5b..dafb9cd 100644 --- a/test/Java/RMIC.py +++ b/test/Java/RMIC.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os diff --git a/test/Java/RMICCOM.py b/test/Java/RMICCOM.py index 9f6595d..8a00b25 100644 --- a/test/Java/RMICCOM.py +++ b/test/Java/RMICCOM.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test the ability to configure the $RMICCOM construction variable. diff --git a/test/Java/RMICCOMSTR.py b/test/Java/RMICCOMSTR.py index d4d1904..2425a3d 100644 --- a/test/Java/RMICCOMSTR.py +++ b/test/Java/RMICCOMSTR.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test that the $RMICCOMSTR construction variable allows you to configure diff --git a/test/Java/jar_not_in_PATH.py b/test/Java/jar_not_in_PATH.py index d69f9c3..26e92ce 100644 --- a/test/Java/jar_not_in_PATH.py +++ b/test/Java/jar_not_in_PATH.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Ensures that the Tool gets initialized, even when jar is not directly diff --git a/test/Java/multi-step.py b/test/Java/multi-step.py index b3f9896..37656b8 100644 --- a/test/Java/multi-step.py +++ b/test/Java/multi-step.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -26,8 +28,6 @@ Real-world test (courtesy Leanid Nazdrynau) of the multi-step capabilities of the various Java Builders. """ -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - import os import TestSCons diff --git a/test/Java/nested-classes.py b/test/Java/nested-classes.py index 0208eb6..6f4aff9 100644 --- a/test/Java/nested-classes.py +++ b/test/Java/nested-classes.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,15 +22,11 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test Java compilation with inner and anonymous classes (Issue 2087). """ - import TestSCons _python_ = TestSCons._python_ diff --git a/test/Java/no-JARCHDIR.py b/test/Java/no-JARCHDIR.py index 11754c0..d339251 100644 --- a/test/Java/no-JARCHDIR.py +++ b/test/Java/no-JARCHDIR.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify the Jar() behavior when we have no JARCHDIR set (it should diff --git a/test/Java/rmic_not_in_PATH.py b/test/Java/rmic_not_in_PATH.py index 9c7030c..ac3f28e 100644 --- a/test/Java/rmic_not_in_PATH.py +++ b/test/Java/rmic_not_in_PATH.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Ensures that the Tool gets initialized, even when rmic is not directly diff --git a/test/Java/source-files.py b/test/Java/source-files.py index e5cb8b6..23e5ebc 100644 --- a/test/Java/source-files.py +++ b/test/Java/source-files.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that we can pass the Java() builder explicit lists of .java @@ -31,8 +30,6 @@ files as sources. import TestSCons -_python_ = TestSCons._python_ - test = TestSCons.TestSCons() # Keep this logic because it skips the test if javac or jar not found. @@ -40,10 +37,10 @@ where_javac, java_version = test.java_where_javac() where_jar = test.java_where_jar() test.write('SConstruct', """ -env = Environment(tools = ['javac', 'javah']) -env.Java(target = 'class1', source = 'com/Example1.java') -env.Java(target = 'class2', source = ['com/Example2.java', 'com/Example3.java']) -""" % locals()) +env = Environment(tools=['javac']) +env.Java(target='class1', source='com/Example1.java') +env.Java(target='class2', source=['com/Example2.java', 'com/Example3.java']) +""") test.subdir('com', 'src') diff --git a/test/Java/swig-dependencies.py b/test/Java/swig-dependencies.py index c1821f8..48010ad 100644 --- a/test/Java/swig-dependencies.py +++ b/test/Java/swig-dependencies.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that dependencies on SWIG-generated .java files work correctly. @@ -39,8 +38,6 @@ if not swig: test.skip_test('Can not find installed "swig", skipping test.\n') where_javac, java_version = test.java_where_javac() -where_javah = test.java_where_javah() - where_java_include=test.java_where_includes() test.subdir(['foo'], @@ -50,11 +47,11 @@ test.subdir(['foo'], test.write(['SConstruct'], """\ import os -env = Environment(ENV = os.environ) +env = Environment(ENV=os.environ) if env['PLATFORM'] != 'win32': - env.Append(CPPFLAGS = ' -g -Wall') -env['CPPPATH'] ='$JAVAINCLUDES' - + env.Append(CPPFLAGS=' -g -Wall') +env['CPPPATH'] = '$JAVAINCLUDES' + Export('env') SConscript('#foo/SConscript') -- cgit v0.12 From c8a32bbade10418eb613ac5c4be90ea6494d6aa8 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 31 Oct 2021 12:34:13 -0600 Subject: Skip unusable javah tests For the three tests which fail, skip if the command finder (WhereIs), which is much less aggressive than the java_where_j* routines, doesn't find javah. Split the JAVAH test file into two files, so that the part which doesn't call javah can run even if the rest is skipped. Did the header cleanup and partial reformats on those. Leave a comment in the Repository/JavaH test, and do some reformatting there as well. Test needs rework, but for now doesn't fail so leave alone. Signed-off-by: Mats Wichmann --- CHANGES.txt | 3 +- test/Java/JAVACLASSPATH.py | 15 ++++-- test/Java/JAVAH-mock.py | 100 ++++++++++++++++++++++++++++++++++ test/Java/JAVAH.py | 69 +++--------------------- test/Java/multi-step.py | 132 ++++++++++++++++++++++++--------------------- test/Repository/JavaH.py | 41 +++++++------- 6 files changed, 214 insertions(+), 146 deletions(-) create mode 100644 test/Java/JAVAH-mock.py diff --git a/CHANGES.txt b/CHANGES.txt index f6dbf5f..b4cde3d 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -80,7 +80,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER if doing SUBST_RAW (issue #4037) - Update Util/NodeList implementation to get rid of a workaround for early Python 3 slicing issue that is no longer a problem. - + - Rework some Java tests to skip rather than fail on CI systems, where + the working java is > v9, but a 1.8 or 9 was also found. From Brian Quistorff: - Fix crash when scons is run from a python environement where a signal diff --git a/test/Java/JAVACLASSPATH.py b/test/Java/JAVACLASSPATH.py index aefacca..6f062db 100644 --- a/test/Java/JAVACLASSPATH.py +++ b/test/Java/JAVACLASSPATH.py @@ -38,11 +38,18 @@ test = TestSCons.TestSCons() where_javac, java_version = test.java_where_javac() where_javah = test.java_where_javah() +# TODO rework for 'javac -h', for now skip +# The logical test would be: +# if float(java_version) > 9: +# but java_where_javac() lies on a multi-java system +if not test.Environment().WhereIs('javah'): + test.skip_test("No Java javah for version > 9, skipping test.\n") + test.write('SConstruct', """ -env = Environment(tools = ['javac', 'javah']) -j1 = env.Java(target = 'class1', source = 'com.1/Example1.java') -j2 = env.Java(target = 'class2', source = 'com.2/Example2.java') -env.JavaH(target = 'outdir', source = [j1, j2], JAVACLASSPATH = 'class2') +env = Environment(tools=['javac', 'javah']) +j1 = env.Java(target='class1', source='com.1/Example1.java') +j2 = env.Java(target='class2', source='com.2/Example2.java') +env.JavaH(target='outdir', source=[j1, j2], JAVACLASSPATH='class2') """ % locals()) test.subdir('com.1', 'com.2') diff --git a/test/Java/JAVAH-mock.py b/test/Java/JAVAH-mock.py new file mode 100644 index 0000000..e44f533 --- /dev/null +++ b/test/Java/JAVAH-mock.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# +# MIT License +# +# Copyright The SCons Foundation +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +Test JavaH without calling the tool +Split from rest of test to allow these to run if real javah skipped. +""" + +import os + +import TestSCons + +_python_ = TestSCons._python_ + +test = TestSCons.TestSCons() + +test.write('myjavah.py', r""" +import sys +args = sys.argv[1:] +while args: + a = args[0] + if a == '-d': + outdir = args[1] + args = args[1:] + elif a == '-o': + outfile = open(args[1], 'w') + args = args[1:] + elif a == '-classpath': + args = args[1:] + elif a == '-sourcepath': + args = args[1:] + else: + break + args = args[1:] +for file in args: + infile = open(file, 'r') + for l in infile.readlines(): + if l[:9] != '/*javah*/': + outfile.write(l) +sys.exit(0) +""") + +test.write('SConstruct', """ +env = Environment(tools=['javah'], JAVAH=r'%(_python_)s myjavah.py') +env.JavaH(target=File('test1.h'), source='test1.java') +""" % locals()) + +test.write('test1.java', """\ +test1.java +/*javah*/ +line 3 +""") + +test.run(arguments='.', stderr=None) +test.must_match('test1.h', "test1.java\nline 3\n", mode='r') + +if os.path.normcase('.java') == os.path.normcase('.JAVA'): + test.write('SConstruct', """\ +env = Environment(tools=['javah'], JAVAH=r'%(_python_)s myjavah.py') +env.JavaH(target=File('test2.h'), source='test2.JAVA') +""" % locals()) + + test.write('test2.JAVA', """\ +test2.JAVA +/*javah*/ +line 3 +""") + + test.run(arguments='.', stderr=None) + test.must_match('test2.h', "test2.JAVA\nline 3\n", mode='r') + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py index 853b2da..bd05e56 100644 --- a/test/Java/JAVAH.py +++ b/test/Java/JAVAH.py @@ -31,70 +31,8 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() -test.write('myjavah.py', r""" -import sys -args = sys.argv[1:] -while args: - a = args[0] - if a == '-d': - outdir = args[1] - args = args[1:] - elif a == '-o': - outfile = open(args[1], 'w') - args = args[1:] - elif a == '-classpath': - args = args[1:] - elif a == '-sourcepath': - args = args[1:] - else: - break - args = args[1:] -for file in args: - infile = open(file, 'r') - for l in infile.readlines(): - if l[:9] != '/*javah*/': - outfile.write(l) -sys.exit(0) -""") - -test.write('SConstruct', """ -env = Environment(tools = ['javah'], - JAVAH = r'%(_python_)s myjavah.py') -env.JavaH(target = File('test1.h'), source = 'test1.java') -""" % locals()) - -test.write('test1.java', """\ -test1.java -/*javah*/ -line 3 -""") - -test.run(arguments='.', stderr=None) - -test.must_match('test1.h', "test1.java\nline 3\n", mode='r') - -if os.path.normcase('.java') == os.path.normcase('.JAVA'): - - test.write('SConstruct', """\ -env = Environment(tools = ['javah'], - JAVAH = r'%(_python_)s myjavah.py') -env.JavaH(target = File('test2.h'), source = 'test2.JAVA') -""" % locals()) - - test.write('test2.JAVA', """\ -test2.JAVA -/*javah*/ -line 3 -""") - - test.run(arguments='.', stderr=None) - - test.must_match('test2.h', "test2.JAVA\nline 3\n", mode='r') - - where_javac, java_version = test.java_where_javac() where_javah = test.java_where_javah() - if java_version: java_version = repr(java_version) @@ -104,6 +42,13 @@ if java_version: if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') +# TODO rework for 'javac -h', for now skip +# The logical test would be: +# if float(java_version) > 9: +# but java_where_javac() lies on a multi-java system +if not test.Environment().WhereIs('javah'): + test.skip_test("No Java javah for version > 9, skipping test.\n") + test.file_fixture('wrapper_with_args.py') test.write('SConstruct', """ diff --git a/test/Java/multi-step.py b/test/Java/multi-step.py index 37656b8..f3eec18 100644 --- a/test/Java/multi-step.py +++ b/test/Java/multi-step.py @@ -26,6 +26,8 @@ """ Real-world test (courtesy Leanid Nazdrynau) of the multi-step capabilities of the various Java Builders. + +TODO: the whole Applet facility is deprecated, need a new test. """ import os @@ -50,27 +52,36 @@ if not swig: if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') -test.subdir(['src'], - ['src', 'HelloApplet'], - ['src', 'HelloApplet', 'com'], - ['src', 'javah'], - ['src', 'jni'], - ['src', 'server'], - ['src', 'server', 'JavaSource'], - ['src', 'server', 'JavaSource', 'com'], - ['src', 'server', 'JavaSource', 'com', 'gnu'], - ['src', 'server', 'JavaSource', 'com', 'gnu', 'scons'], - ['src', 'server', 'JavaSource', 'com', 'gnu', 'scons', 'web'], - ['src', 'server', 'JavaSource', 'com', 'gnu', 'scons', 'web', 'tools'], - ['src', 'server', 'WebContent'], - ['src', 'server', 'WebContent', 'META-INF'], - ['src', 'server', 'WebContent', 'WEB-INF'], - ['src', 'server', 'WebContent', 'WEB-INF', 'conf'], - ['src', 'server', 'WebContent', 'WEB-INF', 'lib'], - ['src', 'server', 'WebContent', 'theme']) +# TODO rework for 'javac -h', for now skip +# The logical test would be: +# if float(java_version) > 9: +# but java_where_javac() lies on a multi-java system +if not test.Environment().WhereIs('javah'): + test.skip_test("No Java javah for version > 9, skipping test.\n") + +test.subdir( + ['src'], + ['src', 'HelloApplet'], + ['src', 'HelloApplet', 'com'], + ['src', 'javah'], + ['src', 'jni'], + ['src', 'server'], + ['src', 'server', 'JavaSource'], + ['src', 'server', 'JavaSource', 'com'], + ['src', 'server', 'JavaSource', 'com', 'gnu'], + ['src', 'server', 'JavaSource', 'com', 'gnu', 'scons'], + ['src', 'server', 'JavaSource', 'com', 'gnu', 'scons', 'web'], + ['src', 'server', 'JavaSource', 'com', 'gnu', 'scons', 'web', 'tools'], + ['src', 'server', 'WebContent'], + ['src', 'server', 'WebContent', 'META-INF'], + ['src', 'server', 'WebContent', 'WEB-INF'], + ['src', 'server', 'WebContent', 'WEB-INF', 'conf'], + ['src', 'server', 'WebContent', 'WEB-INF', 'lib'], + ['src', 'server', 'WebContent', 'theme'], +) test.write(['SConstruct'], """\ -import os,sys +import os, sys if sys.platform == 'win32': # Ensure tests don't pick up link from mingw or cygwin @@ -78,31 +89,35 @@ if sys.platform == 'win32': else: tools = ['default', 'javac', 'javah', 'swig'] -env=Environment(tools = tools, - CPPPATH=["$JAVAINCLUDES"]) +env = Environment(tools=tools, CPPPATH=["$JAVAINCLUDES"]) Export('env') # env.PrependENVPath('PATH',os.environ.get('PATH',[])) -env['INCPREFIX']='-I' -env.Append(SWIGFLAGS=['-c++','$_CPPINCFLAGS']) +env['INCPREFIX'] = '-I' +env.Append(SWIGFLAGS=['-c++', '$_CPPINCFLAGS']) -#this is for JNI -#env.Append(CCFLAGS=['/IN:/jdk/v1.3.1/include','/IN:/jdk/v1.3.1/include/win32']) +# this is for JNI +# env.Append(CCFLAGS=['/IN:/jdk/v1.3.1/include','/IN:/jdk/v1.3.1/include/win32']) -#this for windows only C++ build -#env.Append(CXXFLAGS='-GX') +# this for windows only C++ build +# env.Append(CXXFLAGS='-GX') env.Append(CPPPATH='.') env.VariantDir('buildout', 'src', duplicate=0) -if sys.platform[:6]=='darwin': - env.Append(CPPPATH=['/System/Library/Frameworks/JavaVM.framework/Headers']) - -#If you do not have swig on your system please remove 'buildout/jni/SConscript' line from next call -env.SConscript(['buildout/server/JavaSource/SConscript', - 'buildout/HelloApplet/SConscript', - 'buildout/jni/SConscript', - 'buildout/javah/SConscript']) +if sys.platform[:6] == 'darwin': + env.Append(CPPPATH=['/System/Library/Frameworks/JavaVM.framework/Headers']) + +# If you do not have swig on your system please remove +# 'buildout/jni/SConscript' line from next call +env.SConscript( + [ + 'buildout/server/JavaSource/SConscript', + 'buildout/HelloApplet/SConscript', + 'buildout/jni/SConscript', + 'buildout/javah/SConscript', + ] +) """ % locals()) test.write(['src', 'HelloApplet', 'Hello.html'], """\ @@ -123,21 +138,20 @@ test.write(['src', 'HelloApplet', 'Hello.html'], """\ test.write(['src', 'HelloApplet', 'SConscript'], """\ import os -Import ("env") -denv=env.Clone() -classes=denv.Java(target='classes',source=['com']) -#set correct path for jar -denv['JARCHDIR']=os.path.join(denv.Dir('.').get_abspath(),'classes') -denv.Jar('HelloApplet',classes) +Import("env") +denv = env.Clone() +classes = denv.Java(target='classes', source=['com']) +# set correct path for jar +denv['JARCHDIR'] = os.path.join(denv.Dir('.').get_abspath(), 'classes') +denv.Jar('HelloApplet', classes) -#To sign applet you have to create keystore before and made a calls like this - -#keystore='/path/to/jarsignkey' -#denv['JARSIGNFLAGS']='-keystore '+keystore+' -storepass pass -keypass passkey' -#denv['JARSIGNALIAS']='ALIAS' -#denv['JARCOM']=[denv['JARCOM'],'$JARSIGNCOM'] +# To sign applet you have to create keystore before and made a calls like this +# keystore='/path/to/jarsignkey' +# denv['JARSIGNFLAGS']='-keystore '+keystore+' -storepass pass -keypass passkey' +# denv['JARSIGNALIAS']='ALIAS' +# denv['JARCOM']=[denv['JARCOM'],'$JARSIGNCOM'] """) test.write(['src', 'HelloApplet', 'com', 'Hello.java'], """\ @@ -179,12 +193,11 @@ public class MyID test.write(['src', 'javah', 'SConscript'], """\ Import('env') -denv=env.Clone() -denv['JARCHDIR']=denv.Dir('.').get_abspath() -denv.Jar('myid','MyID.java') -denv.JavaH(denv.Dir('.').get_abspath(),'MyID.java') -denv.SharedLibrary('myid','MyID.cc') - +denv = env.Clone() +denv['JARCHDIR'] = denv.Dir('.').get_abspath() +denv.Jar('myid', 'MyID.java') +denv.JavaH(denv.Dir('.').get_abspath(), 'MyID.java') +denv.SharedLibrary('myid', 'MyID.cc') """) test.write(['src', 'jni', 'A.java'], """\ @@ -225,8 +238,6 @@ test.write(['src', 'jni', 'JniWrapper.cc'], """\ #include "JniWrapper.h" - - JniWrapper::JniWrapper( JNIEnv *pEnv ) : mpEnv( pEnv ) { @@ -239,7 +250,6 @@ JniWrapper::JniWrapper( const JniWrapper& rJniWrapper ) JniWrapper::~JniWrapper() { - } JniWrapper& JniWrapper::operator=( const JniWrapper& rJniWrapper ) @@ -373,13 +383,13 @@ private: """) test.write(['src', 'jni', 'SConscript'], """\ -Import ("env") -denv=env.Clone() +Import("env") +denv = env.Clone() denv.Append(SWIGFLAGS=['-java']) -denv.SharedLibrary('scons',['JniWrapper.cc','Sample.i']) -denv['JARCHDIR']=denv.Dir('.').get_abspath() -denv.Jar(['Sample.i','A.java']) +denv.SharedLibrary('scons', ['JniWrapper.cc', 'Sample.i']) +denv['JARCHDIR'] = denv.Dir('.').get_abspath() +denv.Jar(['Sample.i', 'A.java']) """) test.write(['src', 'jni', 'Sample.h'], """\ diff --git a/test/Repository/JavaH.py b/test/Repository/JavaH.py index 1cb5078..77f097d 100644 --- a/test/Repository/JavaH.py +++ b/test/Repository/JavaH.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test building Java applications when using Repositories. @@ -44,13 +43,23 @@ java = where_java javac = where_javac javah = where_javah +# TODO: javah no longer exists for Java > 9. Other tests fail +# on certain systems because the java_where_* routines are very greedy +# and may indicate it's found even if the working java is > 9 if there +# was a 1.8 insallation present - and then at runtime it's not found. +# In this case we actually pass the javac/javah that's found by those, +# which means the test will seem to work. We still need to rework this. + ############################################################################### # -test.subdir('rep1', ['rep1', 'src'], - 'work1', - 'work2', - 'work3') +test.subdir( + 'rep1', + ['rep1', 'src'], + 'work1', + 'work2', + 'work3' +) # rep1_classes = test.workpath('rep1', 'classes') @@ -62,11 +71,9 @@ opts = '-Y ' + test.workpath('rep1') # test.write(['rep1', 'SConstruct'], """ -env = Environment(tools = ['javac', 'javah'], - JAVAC = r'"%s"', - JAVAH = r'"%s"') -classes = env.Java(target = 'classes', source = 'src') -env.JavaH(target = 'outdir', source = classes) +env = Environment(tools=['javac', 'javah'], JAVAC=r'"%s"', JAVAH=r'"%s"') +classes = env.Java(target='classes', source='src') +env.JavaH(target='outdir', source=classes) """ % (javac, javah)) test.write(['rep1', 'src', 'Foo1.java'], """\ @@ -206,11 +213,9 @@ test.up_to_date(chdir = 'work2', options = opts, arguments = ".") # test.write(['work3', 'SConstruct'], """ -env = Environment(tools = ['javac', 'javah'], - JAVAC = r'"%s"', - JAVAH = r'"%s"') -classes = env.Java(target = 'classes', source = 'src') -hfiles = env.JavaH(target = 'outdir', source = classes) +env = Environment(tools=['javac', 'javah'], JAVAC=r'"%s"', JAVAH=r'"%s"') +classes = env.Java(target='classes', source='src') +hfiles = env.JavaH(target='outdir', source=classes) Local(hfiles) """ % (javac, javah)) -- cgit v0.12 From 4fc7d2a63b0e0aad569d4218e8b8b28a68db8520 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 1 Nov 2021 10:59:18 -0600 Subject: Add an extra check for javah The previous sanity check was to see if the less-optimistic WhereIs could find javah, and skip if not, since java_where_javah looks many more places than SCons will actually look. This was insufficient - some openjdk packages don't clean up the alternatives link to javah even if a java version which doesn't have it becomes the selected version. Add a check on found paths to detect a mismatch. Signed-off-by: Mats Wichmann --- test/Java/JAVACLASSPATH.py | 14 ++++++++-- test/Java/JAVAH.py | 69 +++++++++++++++++++++++++++++----------------- test/Java/multi-step.py | 13 +++++++-- 3 files changed, 65 insertions(+), 31 deletions(-) diff --git a/test/Java/JAVACLASSPATH.py b/test/Java/JAVACLASSPATH.py index 6f062db..aff3a90 100644 --- a/test/Java/JAVACLASSPATH.py +++ b/test/Java/JAVACLASSPATH.py @@ -29,6 +29,8 @@ files in alternate locations by adding the -classpath option to the javac command line. """ +import pathlib + import TestSCons _python_ = TestSCons._python_ @@ -39,12 +41,18 @@ where_javac, java_version = test.java_where_javac() where_javah = test.java_where_javah() # TODO rework for 'javac -h', for now skip -# The logical test would be: -# if float(java_version) > 9: -# but java_where_javac() lies on a multi-java system +# The logical test would be: if java_version > 9: +# but java_where_javah() roots around and will find from an older version if not test.Environment().WhereIs('javah'): test.skip_test("No Java javah for version > 9, skipping test.\n") +# On some systems, the alternatives system does not remove javah even if the +# preferred Java doesn't have it, so try another check +javacdir = pathlib.Path(where_javac).parent +javahdir = pathlib.Path(where_javah).parent +if javacdir != javahdir: + test.skip_test("Cannot find Java javah matching javac, skipping test.\n") + test.write('SConstruct', """ env = Environment(tools=['javac', 'javah']) j1 = env.Java(target='class1', source='com.1/Example1.java') diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py index bd05e56..8be3196 100644 --- a/test/Java/JAVAH.py +++ b/test/Java/JAVAH.py @@ -24,6 +24,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import os +import pathlib import TestSCons @@ -43,42 +44,56 @@ if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') # TODO rework for 'javac -h', for now skip -# The logical test would be: -# if float(java_version) > 9: -# but java_where_javac() lies on a multi-java system +# The logical test would be: if java_version > 9: +# but java_where_javah() roots around and will find from an older version if not test.Environment().WhereIs('javah'): test.skip_test("No Java javah for version > 9, skipping test.\n") +# On some systems, the alternatives system does not remove javah even if the +# preferred Java doesn't have it, so try another check +javacdir = pathlib.Path(where_javac).parent +javahdir = pathlib.Path(where_javah).parent +if javacdir != javahdir: + test.skip_test("Cannot find Java javah matching javac, skipping test.\n") + test.file_fixture('wrapper_with_args.py') test.write('SConstruct', """ -foo = Environment(tools = ['javac', 'javah', 'install']) +foo = Environment(tools=['javac', 'javah', 'install']) jv = %(java_version)s if jv: foo['JAVAVERSION'] = jv javah = foo.Dictionary('JAVAH') -bar = foo.Clone(JAVAH = r'%(_python_)s wrapper_with_args.py ' + javah) -foo.Java(target = 'class1', source = 'com/sub/foo') -bar_classes = bar.Java(target = 'class2', source = 'com/sub/bar') -foo_classes = foo.Java(target = 'class3', source = 'src') -foo.JavaH(target = 'outdir1', - source = ['class1/com/sub/foo/Example1.class', - 'class1/com/other/Example2', - 'class1/com/sub/foo/Example3'], - JAVACLASSDIR = 'class1') -bar.JavaH(target = 'outdir2', source = bar_classes) -foo.JavaH(target = File('output.h'), source = foo_classes) +bar = foo.Clone(JAVAH=r'%(_python_)s wrapper_with_args.py ' + javah) +foo.Java(target='class1', source='com/sub/foo') +bar_classes = bar.Java(target='class2', source='com/sub/bar') +foo_classes = foo.Java(target='class3', source='src') +foo.JavaH( + target='outdir1', + source=[ + 'class1/com/sub/foo/Example1.class', + 'class1/com/other/Example2', + 'class1/com/sub/foo/Example3', + ], + JAVACLASSDIR='class1', +) +bar.JavaH(target='outdir2', source=bar_classes) +foo.JavaH(target=File('output.h'), source=foo_classes) foo.Install('class4/com/sub/foo', 'class1/com/sub/foo/Example1.class') -foo.JavaH(target = 'outdir4', - source = ['class4/com/sub/foo/Example1.class'], - JAVACLASSDIR = 'class4') +foo.JavaH( + target='outdir4', + source=['class4/com/sub/foo/Example1.class'], + JAVACLASSDIR='class4', +) """ % locals()) -test.subdir('com', - ['com', 'sub'], - ['com', 'sub', 'foo'], - ['com', 'sub', 'bar'], - 'src') +test.subdir( + 'com', + ['com', 'sub'], + ['com', 'sub', 'foo'], + ['com', 'sub', 'bar'], + 'src', +) test.write(['com', 'sub', 'foo', 'Example1.java'], """\ package com.sub.foo; @@ -224,8 +239,12 @@ class Private { test.run(arguments = '.') -test.must_match('wrapper.out', "wrapper_with_args.py javah -d outdir2 -classpath class2 com.sub.bar.Example4 com.other.Example5 com.sub.bar.Example6\n" % locals(), - mode='r') +test.must_match( + 'wrapper.out', + "wrapper_with_args.py javah -d outdir2 -classpath class2 com.sub.bar.Example4 com.other.Example5 com.sub.bar.Example6\n" + % locals(), + mode='r', +) test.must_exist(['outdir1', 'com_sub_foo_Example1.h']) test.must_exist(['outdir1', 'com_other_Example2.h']) diff --git a/test/Java/multi-step.py b/test/Java/multi-step.py index f3eec18..ab627cb 100644 --- a/test/Java/multi-step.py +++ b/test/Java/multi-step.py @@ -31,6 +31,7 @@ TODO: the whole Applet facility is deprecated, need a new test. """ import os +import pathlib import TestSCons @@ -53,12 +54,18 @@ if test.javac_is_gcj: test.skip_test('Test not valid for gcj (gnu java); skipping test(s).\n') # TODO rework for 'javac -h', for now skip -# The logical test would be: -# if float(java_version) > 9: -# but java_where_javac() lies on a multi-java system +# The logical test would be: if java_version > 9: +# but java_where_javah() roots around and will find from an older version if not test.Environment().WhereIs('javah'): test.skip_test("No Java javah for version > 9, skipping test.\n") +# On some systems, the alternatives system does not remove javah even if the +# preferred Java doesn't have it, so try another check +javacdir = pathlib.Path(where_javac).parent +javahdir = pathlib.Path(where_javah).parent +if javacdir != javahdir: + test.skip_test("Cannot find Java javah matching javac, skipping test.\n") + test.subdir( ['src'], ['src', 'HelloApplet'], -- cgit v0.12 From 850bc69d26d078008e750b1a6c096655499bb1ca Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Mon, 1 Nov 2021 11:53:11 -0600 Subject: Also make Repository/JavaH test skip if mismatched javah Signed-off-by: Mats Wichmann --- test/Repository/JavaH.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/Repository/JavaH.py b/test/Repository/JavaH.py index 77f097d..fea5f5b 100644 --- a/test/Repository/JavaH.py +++ b/test/Repository/JavaH.py @@ -28,6 +28,7 @@ Test building Java applications when using Repositories. """ import os +import pathlib import TestSCons @@ -39,6 +40,13 @@ where_javac, java_version = test.java_where_javac() where_java = test.java_where_java() where_javah = test.java_where_javah() +# On some systems, the alternatives system does not remove javah even if the +# preferred Java doesn't have it, check the paths just in case. +javacdir = pathlib.Path(where_javac).parent +javahdir = pathlib.Path(where_javah).parent +if javacdir != javahdir: + test.skip_test("Cannot find Java javah matching javac, skipping test.\n") + java = where_java javac = where_javac javah = where_javah @@ -58,7 +66,7 @@ test.subdir( ['rep1', 'src'], 'work1', 'work2', - 'work3' + 'work3', ) # -- cgit v0.12 From e7450cae60e8eb4ca7cb08fb8878c3a7224699b0 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 1 Nov 2021 11:13:35 -0700 Subject: Update copyright text --- SCons/Tool/javac.py | 24 ++++++++++++------------ SCons/Tool/javah.py | 24 +++++++++++------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/SCons/Tool/javac.py b/SCons/Tool/javac.py index fd007eb..ff206c3 100644 --- a/SCons/Tool/javac.py +++ b/SCons/Tool/javac.py @@ -1,15 +1,6 @@ -"""SCons.Tool.javac - -Tool-specific initialization for javac. - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - +# MIT License # -# __COPYRIGHT__ +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -30,7 +21,16 @@ selection method. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" +"""SCons.Tool.javac + +Tool-specific initialization for javac. + +There normally shouldn't be any need to import this module directly. +It will usually be imported through the generic SCons.Tool.Tool() +selection method. + +""" + import os import os.path diff --git a/SCons/Tool/javah.py b/SCons/Tool/javah.py index fbfcbe2..ca5bca3 100644 --- a/SCons/Tool/javah.py +++ b/SCons/Tool/javah.py @@ -1,15 +1,6 @@ -"""SCons.Tool.javah - -Tool-specific initialization for javah. - -There normally shouldn't be any need to import this module directly. -It will usually be imported through the generic SCons.Tool.Tool() -selection method. - -""" - +# MIT License # -# __COPYRIGHT__ +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -29,9 +20,16 @@ selection method. # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# +"""SCons.Tool.javah + +Tool-specific initialization for javah. + +There normally shouldn't be any need to import this module directly. +It will usually be imported through the generic SCons.Tool.Tool() +selection method. + +""" -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os.path -- cgit v0.12 From 506850e230c6d9346fbad25f5957e4cbc3c09040 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 1 Nov 2021 11:16:42 -0700 Subject: Added --no-ignore-skips and changed default to only exit status 2 if this flag is specified to runtest.py and some tests are skipped. Otherwise assuming no failures will exit 0 --- CHANGES.txt | 3 +++ RELEASE.txt | 4 +++- runtest.py | 7 ++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b4cde3d..197efa4 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -24,6 +24,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER introduced by Aaron Franke (listed below) were merged. - Further PCH updates. It's now recommended that env['PCH'] should always be a File node. Either via return value from env.PCH() or by explicitly using File('StdAfx.pch'). + - Added --no-ignore-skips to runtest.py. Changed default to ignore skips when setting + runtest.py's exit status. Previously would exit 2 if any tests were skipped. + Now will only exit 2 if user specifies --no-ignore-skips and some tests were skipped. From Ryan Egesdahl: - Small fix to ensure CLVar default value is an empty list. diff --git a/RELEASE.txt b/RELEASE.txt index 95ee4eb..86f5bff 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -71,7 +71,9 @@ DOCUMENTATION DEVELOPMENT ----------- -- List visible changes in the way SCons is developed +- Added --no-ignore-skips to runtest.py. Changed default to ignore skips when setting + runtest.py's exit status. Previously would exit 2 if any tests were skipped. + Now will only exit 2 if user specifies --no-ignore-skips and some tests were skipped. Thanks to the following contributors listed below for their contributions to this release. ========================================================================================== diff --git a/runtest.py b/runtest.py index 52ceea4..79dce48 100755 --- a/runtest.py +++ b/runtest.py @@ -110,6 +110,11 @@ parser.add_argument('--no-faillog', dest='error_log', default='failed_tests.log', help="Do not log failed tests to a file") +parser.add_argument('--no-ignore-skips', dest='ignore_skips', + action='store_false', + default=True, + help="If any tests are skipped, exit status 2") + outctl = parser.add_argument_group(description='Output control options:') outctl.add_argument('-k', '--no-progress', action='store_false', dest='print_progress', @@ -855,7 +860,7 @@ if args.output: if fail: sys.exit(1) -elif no_result: +elif no_result and args.ignore_skips: # if no fails, but skips were found sys.exit(2) else: -- cgit v0.12 From c90a47623fefb3787b737c014df7392fe325795b Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 1 Nov 2021 12:05:34 -0700 Subject: fix --no-ignore-skips --- runtest.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/runtest.py b/runtest.py index 79dce48..741b256 100755 --- a/runtest.py +++ b/runtest.py @@ -110,9 +110,9 @@ parser.add_argument('--no-faillog', dest='error_log', default='failed_tests.log', help="Do not log failed tests to a file") -parser.add_argument('--no-ignore-skips', dest='ignore_skips', - action='store_false', - default=True, +parser.add_argument('--no-ignore-skips', dest='dont_ignore_skips', + action='store_true', + default=False, help="If any tests are skipped, exit status 2") outctl = parser.add_argument_group(description='Output control options:') @@ -858,9 +858,10 @@ if args.output: if isinstance(sys.stderr, Tee): sys.stderr.file.close() +import pdb; pdb.set_trace() if fail: sys.exit(1) -elif no_result and args.ignore_skips: +elif no_result and args.dont_ignore_skips: # if no fails, but skips were found sys.exit(2) else: -- cgit v0.12 From a2a6c9c333b245530b3ec34c7c8d88fca8d700c4 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 1 Nov 2021 12:10:30 -0700 Subject: fix --no-ignore-skips --- runtest.py | 1 - 1 file changed, 1 deletion(-) diff --git a/runtest.py b/runtest.py index 741b256..1d93b0c 100755 --- a/runtest.py +++ b/runtest.py @@ -858,7 +858,6 @@ if args.output: if isinstance(sys.stderr, Tee): sys.stderr.file.close() -import pdb; pdb.set_trace() if fail: sys.exit(1) elif no_result and args.dont_ignore_skips: -- cgit v0.12 From 5c0d91c3a38effd1ce4305e71168ea9e924437cb Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 1 Nov 2021 12:28:12 -0700 Subject: fixed tests to test --no-ignore-skips, and updated their copyright text --- test/runtest/baseline/no_result.py | 8 +++++++- test/runtest/simple/no_result.py | 15 ++++++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/test/runtest/baseline/no_result.py b/test/runtest/baseline/no_result.py index b63d0c6..d00f536 100644 --- a/test/runtest/baseline/no_result.py +++ b/test/runtest/baseline/no_result.py @@ -48,11 +48,17 @@ expect_stderr = """\ NO RESULT TEST STDERR """ -test.run(arguments='-k -b . test/no_result.py', +test.run(arguments='--no-ignore-skips -k -b . test/no_result.py', status=2, stdout=expect_stdout, stderr=expect_stderr) +test.run(arguments='-k -b . test/no_result.py', + status=0, + stdout=expect_stdout, + stderr=expect_stderr) + + test.pass_test() # Local Variables: diff --git a/test/runtest/simple/no_result.py b/test/runtest/simple/no_result.py index 2fd40b4..33f28e4 100644 --- a/test/runtest/simple/no_result.py +++ b/test/runtest/simple/no_result.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test how we handle a no-results test specified on the command line. @@ -48,11 +47,17 @@ expect_stderr = """\ NO RESULT TEST STDERR """ -test.run(arguments='-k test/no_result.py', +test.run(arguments='--no-ignore-skips -k test/no_result.py', status=2, stdout=expect_stdout, stderr=expect_stderr) +test.run(arguments='-k test/no_result.py', + status=0, + stdout=expect_stdout, + stderr=expect_stderr) + + test.pass_test() # Local Variables: -- cgit v0.12