diff options
| author | Russel Winder <russel@winder.org.uk> | 2014-08-09 17:53:22 (GMT) |
|---|---|---|
| committer | Russel Winder <russel@winder.org.uk> | 2014-08-09 17:53:22 (GMT) |
| commit | 22f309a6bfcc2621fc7011813adbb14efa4559c5 (patch) | |
| tree | 61e10cf8079f383863e8bdf44c1559a688e415c2 /test | |
| parent | 032c4d44d99c4ea306f2541cafa9150e57024c21 (diff) | |
| parent | 1e7356e2a4f660c6f1cd42b92aec0c47233c1a2d (diff) | |
| download | SCons-22f309a6bfcc2621fc7011813adbb14efa4559c5.zip SCons-22f309a6bfcc2621fc7011813adbb14efa4559c5.tar.gz SCons-22f309a6bfcc2621fc7011813adbb14efa4559c5.tar.bz2 | |
Merge heads.
Diffstat (limited to 'test')
| -rw-r--r-- | test/CPPDEFINES/append.py | 75 | ||||
| -rw-r--r-- | test/Copy-Symlinks.py | 174 | ||||
| -rw-r--r-- | test/Deprecated/SourceCode/SourceCode.py | 2 | ||||
| -rw-r--r-- | test/Java/DerivedSourceTest.py | 124 | ||||
| -rw-r--r-- | test/Java/RMIC.py | 89 | ||||
| -rw-r--r-- | test/TEX/biblatex_plain.py | 1 |
6 files changed, 389 insertions, 76 deletions
diff --git a/test/CPPDEFINES/append.py b/test/CPPDEFINES/append.py index 2dacd8a..6e69d09 100644 --- a/test/CPPDEFINES/append.py +++ b/test/CPPDEFINES/append.py @@ -47,18 +47,17 @@ print env_1738_2.subst('$_CPPDEFFLAGS') env_2300_1 = Environment(CPPDEFINES = 'foo', CPPDEFPREFIX='-D') env_2300_1.Append(CPPDEFINES='bar') print env_2300_1.subst('$_CPPDEFFLAGS') -#env_2300_1.Object('test_2300_1', 'main.c') env_2300_2 = Environment(CPPDEFINES = ['foo'], CPPDEFPREFIX='-D') # note the list env_2300_2.Append(CPPDEFINES='bar') print env_2300_2.subst('$_CPPDEFFLAGS') -#env_2300_2.Object('test_2300_2', 'main.c') # http://scons.tigris.org/issues/show_bug.cgi?id=1152 +# http://scons.tigris.org/issues/show_bug.cgi?id=2900 cases=[('string', 'FOO'), ('list', ['NAME1', 'NAME2']), ('list-of-2lists', [('NAME1','VAL1'), ['NAME2','VAL2']]), - ('dict', {'NAME1' : 'VAL1', 'NAME2' : 'VAL2'}) + ('dict', {'NAME1' : 'VAL1', 'NAME2' : 'VAL2', 'NAME3' : None}) ] for (t1, c1) in cases: @@ -107,13 +106,13 @@ AppendUnique: result=[('FOO',), ('NAME1', 'VAL1'), ('NAME2', 'VAL2')] final=-DFOO -DNAME1=VAL1 -DNAME2=VAL2 ==== Testing CPPDEFINES, appending a dict to a string - orig = FOO, append = {'NAME2': 'VAL2', 'NAME1': 'VAL1'} + orig = FOO, append = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'} Append: - result=['FOO', {'NAME2': 'VAL2', 'NAME1': 'VAL1'}] - final=-DFOO -DNAME2=VAL2 -DNAME1=VAL1 + result=['FOO', {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'}] + final=-DFOO -DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 AppendUnique: - result=['FOO', ('NAME2', 'VAL2'), ('NAME1', 'VAL1')] - final=-DFOO -DNAME2=VAL2 -DNAME1=VAL1 + result=['FOO', ('NAME2', 'VAL2'), 'NAME3', ('NAME1', 'VAL1')] + final=-DFOO -DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 ==== Testing CPPDEFINES, appending a string to a list orig = ['NAME1', 'NAME2'], append = FOO Append: @@ -139,13 +138,13 @@ AppendUnique: result=[('NAME1',), ('NAME2',), ('NAME1', 'VAL1'), ('NAME2', 'VAL2')] final=-DNAME1 -DNAME2 -DNAME1=VAL1 -DNAME2=VAL2 ==== Testing CPPDEFINES, appending a dict to a list - orig = ['NAME1', 'NAME2'], append = {'NAME2': 'VAL2', 'NAME1': 'VAL1'} + orig = ['NAME1', 'NAME2'], append = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'} Append: - result=['NAME1', 'NAME2', {'NAME2': 'VAL2', 'NAME1': 'VAL1'}] - final=-DNAME1 -DNAME2 -DNAME2=VAL2 -DNAME1=VAL1 + result=['NAME1', 'NAME2', {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'}] + final=-DNAME1 -DNAME2 -DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 AppendUnique: - result=[('NAME1',), ('NAME2',), ('NAME2', 'VAL2'), ('NAME1', 'VAL1')] - final=-DNAME1 -DNAME2 -DNAME2=VAL2 -DNAME1=VAL1 + result=[('NAME1',), ('NAME2',), ('NAME2', 'VAL2'), ('NAME3',), ('NAME1', 'VAL1')] + final=-DNAME1 -DNAME2 -DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 ==== Testing CPPDEFINES, appending a string to a list-of-2lists orig = [('NAME1', 'VAL1'), ['NAME2', 'VAL2']], append = FOO Append: @@ -171,45 +170,45 @@ AppendUnique: result=[('NAME1', 'VAL1'), ('NAME2', 'VAL2')] final=-DNAME1=VAL1 -DNAME2=VAL2 ==== Testing CPPDEFINES, appending a dict to a list-of-2lists - orig = [('NAME1', 'VAL1'), ['NAME2', 'VAL2']], append = {'NAME2': 'VAL2', 'NAME1': 'VAL1'} + orig = [('NAME1', 'VAL1'), ['NAME2', 'VAL2']], append = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'} Append: - result=[('NAME1', 'VAL1'), ['NAME2', 'VAL2'], {'NAME2': 'VAL2', 'NAME1': 'VAL1'}] - final=-DNAME1=VAL1 -DNAME2=VAL2 -DNAME2=VAL2 -DNAME1=VAL1 + result=[('NAME1', 'VAL1'), ['NAME2', 'VAL2'], {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'}] + final=-DNAME1=VAL1 -DNAME2=VAL2 -DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 AppendUnique: - result=[('NAME2', 'VAL2'), ('NAME1', 'VAL1')] - final=-DNAME2=VAL2 -DNAME1=VAL1 + result=[('NAME2', 'VAL2'), ('NAME3',), ('NAME1', 'VAL1')] + final=-DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 ==== Testing CPPDEFINES, appending a string to a dict - orig = {'NAME2': 'VAL2', 'NAME1': 'VAL1'}, append = FOO + orig = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'}, append = FOO Append: - result={'FOO': None, 'NAME2': 'VAL2', 'NAME1': 'VAL1'} - final=-DFOO -DNAME1=VAL1 -DNAME2=VAL2 + result={'FOO': None, 'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'} + final=-DFOO -DNAME1=VAL1 -DNAME2=VAL2 -DNAME3 AppendUnique: - result=[('NAME2', 'VAL2'), ('NAME1', 'VAL1'), 'FOO'] - final=-DNAME2=VAL2 -DNAME1=VAL1 -DFOO + result=[('NAME2', 'VAL2'), ('NAME3',), ('NAME1', 'VAL1'), 'FOO'] + final=-DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 -DFOO ==== Testing CPPDEFINES, appending a list to a dict - orig = {'NAME2': 'VAL2', 'NAME1': 'VAL1'}, append = ['NAME1', 'NAME2'] + orig = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'}, append = ['NAME1', 'NAME2'] Append: - result=[('NAME2', 'VAL2'), ('NAME1', 'VAL1'), 'NAME1', 'NAME2'] - final=-DNAME2=VAL2 -DNAME1=VAL1 -DNAME1 -DNAME2 + result=[('NAME2', 'VAL2'), ('NAME3',), ('NAME1', 'VAL1'), 'NAME1', 'NAME2'] + final=-DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 -DNAME1 -DNAME2 AppendUnique: - result=[('NAME2', 'VAL2'), ('NAME1', 'VAL1'), ('NAME1',), ('NAME2',)] - final=-DNAME2=VAL2 -DNAME1=VAL1 -DNAME1 -DNAME2 + result=[('NAME2', 'VAL2'), ('NAME3',), ('NAME1', 'VAL1'), ('NAME1',), ('NAME2',)] + final=-DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 -DNAME1 -DNAME2 ==== Testing CPPDEFINES, appending a list-of-2lists to a dict - orig = {'NAME2': 'VAL2', 'NAME1': 'VAL1'}, append = [('NAME1', 'VAL1'), ['NAME2', 'VAL2']] + orig = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'}, append = [('NAME1', 'VAL1'), ['NAME2', 'VAL2']] Append: - result=[('NAME2', 'VAL2'), ('NAME1', 'VAL1'), ('NAME1', 'VAL1'), ['NAME2', 'VAL2']] - final=-DNAME2=VAL2 -DNAME1=VAL1 -DNAME1=VAL1 -DNAME2=VAL2 + result=[('NAME2', 'VAL2'), ('NAME3',), ('NAME1', 'VAL1'), ('NAME1', 'VAL1'), ['NAME2', 'VAL2']] + final=-DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 -DNAME1=VAL1 -DNAME2=VAL2 AppendUnique: - result=[('NAME2', 'VAL2'), ('NAME1', 'VAL1')] - final=-DNAME2=VAL2 -DNAME1=VAL1 + result=[('NAME2', 'VAL2'), ('NAME3',), ('NAME1', 'VAL1')] + final=-DNAME2=VAL2 -DNAME3 -DNAME1=VAL1 ==== Testing CPPDEFINES, appending a dict to a dict - orig = {'NAME2': 'VAL2', 'NAME1': 'VAL1'}, append = {'NAME2': 'VAL2', 'NAME1': 'VAL1'} + orig = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'}, append = {'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'} Append: - result={'NAME2': 'VAL2', 'NAME1': 'VAL1'} - final=-DNAME1=VAL1 -DNAME2=VAL2 + result={'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'} + final=-DNAME1=VAL1 -DNAME2=VAL2 -DNAME3 AppendUnique: - result={'NAME2': 'VAL2', 'NAME1': 'VAL1'} - final=-DNAME1=VAL1 -DNAME2=VAL2 + result={'NAME2': 'VAL2', 'NAME3': None, 'NAME1': 'VAL1'} + final=-DNAME1=VAL1 -DNAME2=VAL2 -DNAME3 """ build_output="scons: `.' is up to date.\n" diff --git a/test/Copy-Symlinks.py b/test/Copy-Symlinks.py new file mode 100644 index 0000000..f8f92d7 --- /dev/null +++ b/test/Copy-Symlinks.py @@ -0,0 +1,174 @@ +#!/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 +# 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. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Verify that the Copy() Action symlink soft-copy support works. +""" + +import os +import stat +import sys +import TestSCons + +import SCons.Defaults +SCons.Defaults.DefaultEnvironment( tools = [] ) + +test = TestSCons.TestSCons() + +filelinkToCopy = 'filelinkToCopy' +fileToLink = 'file.in' +fileContents = 'stuff n things\n' +dirToLink = 'dir' +dirlinkToCopy = 'dirlinkToCopy' +treeToLink = 'tree' +treelinkToCopy = 'treelinkToCopy' +badToLink = 'None' # do not write this item +badlinkToCopy = 'badlinkToCopy' + +try: + test.symlink( fileToLink, filelinkToCopy ) + test.symlink( dirToLink, dirlinkToCopy ) + test.symlink( treeToLink, treelinkToCopy ) + test.symlink( badToLink, badlinkToCopy ) +except: + test.no_result() + +test.write( fileToLink, fileContents ) +test.subdir( dirToLink ) +test.subdir( treeToLink ) +test.write( os.path.join( treeToLink, fileToLink ), fileContents ) + +test.write('SConstruct', +"""\ +import SCons.Defaults +SCons.Defaults.DefaultEnvironment( tools = [] ) + +Execute( Copy( 'F1', '%(filelinkToCopy)s', False ) ) +Execute( Copy( 'L1', '%(filelinkToCopy)s' ) ) +Execute( Copy( 'L2', '%(filelinkToCopy)s', True ) ) + +Execute( Copy( 'D1', '%(dirlinkToCopy)s', False ) ) +Execute( Copy( 'L3', '%(dirlinkToCopy)s' ) ) +Execute( Copy( 'L4', '%(dirlinkToCopy)s', True ) ) + +Execute( Copy( 'T1', '%(treelinkToCopy)s', False ) ) +Execute( Copy( 'L5', '%(treelinkToCopy)s' ) ) +Execute( Copy( 'L6', '%(treelinkToCopy)s', True ) ) + +Execute( Copy( 'Fails', '%(badlinkToCopy)s', False ) ) +Execute( Copy( 'L7', '%(badlinkToCopy)s' ) ) +Execute( Copy( 'L8', '%(badlinkToCopy)s', True ) ) +""" +% locals() +) + +test.must_exist( 'SConstruct' ) +test.must_exist( fileToLink ) +test.must_exist( filelinkToCopy ) +test.must_exist( dirlinkToCopy ) +test.must_exist( treelinkToCopy ) +test.must_not_exist( badToLink ) +test.must_exist( badlinkToCopy ) + +expectStdout = test.wrap_stdout( +read_str = +'''\ +Copy("F1", "%(filelinkToCopy)s") +Copy("L1", "%(filelinkToCopy)s") +Copy("L2", "%(filelinkToCopy)s") +Copy("D1", "%(dirlinkToCopy)s") +Copy("L3", "%(dirlinkToCopy)s") +Copy("L4", "%(dirlinkToCopy)s") +Copy("T1", "%(treelinkToCopy)s") +Copy("L5", "%(treelinkToCopy)s") +Copy("L6", "%(treelinkToCopy)s") +Copy("Fails", "badlinkToCopy") +Copy("L7", "%(badlinkToCopy)s") +Copy("L8", "%(badlinkToCopy)s") +''' % locals(), +build_str = +'''\ +scons: `.' is up to date. +''' +) + +expectStderr = \ +'''\ +scons: *** None: No such file or directory +''' + +test.run( stdout = expectStdout, stderr = expectStderr, status = None ) + +test.must_exist('D1') +test.must_exist('F1') +test.must_exist('L2') +test.must_exist('L3') +test.must_exist('L4') +test.must_exist('L5') +test.must_exist('L6') +test.must_exist('L7') +test.must_exist('L8') +test.must_exist('T1') +test.must_not_exist( 'Fails' ) + +test.must_match( fileToLink, fileContents ) +test.must_match( 'F1', fileContents ) +test.must_match( 'L1', fileContents ) +test.must_match( 'L2', fileContents ) +test.must_match( os.path.join( treeToLink, fileToLink ), fileContents ) + +test.fail_test( condition=os.path.islink('D1') ) +test.fail_test( condition=os.path.islink('F1') ) +test.fail_test( condition=os.path.islink('T1') ) +test.fail_test( condition=(not os.path.isdir('D1')) ) +test.fail_test( condition=(not os.path.isfile('F1')) ) +test.fail_test( condition=(not os.path.isdir('T1')) ) +test.fail_test( condition=(not os.path.islink('L1')) ) +test.fail_test( condition=(not os.path.islink('L2')) ) +test.fail_test( condition=(not os.path.islink('L3')) ) +test.fail_test( condition=(not os.path.islink('L4')) ) +test.fail_test( condition=(not os.path.islink('L5')) ) +test.fail_test( condition=(not os.path.islink('L6')) ) +test.fail_test( condition=(not os.path.islink('L7')) ) +test.fail_test( condition=(not os.path.islink('L8')) ) +test.fail_test( condition=(os.path.exists('L7')) ) +test.fail_test( condition=(os.path.exists('L8')) ) +test.fail_test( condition=(os.readlink(filelinkToCopy) != os.readlink('L1')) ) +test.fail_test( condition=(os.readlink(filelinkToCopy) != os.readlink('L2')) ) +test.fail_test( condition=(os.readlink(dirlinkToCopy) != os.readlink('L3')) ) +test.fail_test( condition=(os.readlink(dirlinkToCopy) != os.readlink('L4')) ) +test.fail_test( condition=(os.readlink(treelinkToCopy) != os.readlink('L5')) ) +test.fail_test( condition=(os.readlink(treelinkToCopy) != os.readlink('L6')) ) +test.fail_test( condition=(os.readlink(badlinkToCopy) != os.readlink('L7')) ) +test.fail_test( condition=(os.readlink(badlinkToCopy) != os.readlink('L8')) ) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/test/Deprecated/SourceCode/SourceCode.py b/test/Deprecated/SourceCode/SourceCode.py index 2bf990f..b5c0ba9 100644 --- a/test/Deprecated/SourceCode/SourceCode.py +++ b/test/Deprecated/SourceCode/SourceCode.py @@ -38,7 +38,7 @@ SourceCode('.', None) """) msg = """SourceCode() has been deprecated and there is no replacement. -\tIf you need this function, please contact scons-dev@tigris.org""" +\tIf you need this function, please contact scons-dev@scons.org""" warning = test.deprecated_warning('deprecated-source-code', msg) test.subdir('sub', 'sub2') diff --git a/test/Java/DerivedSourceTest.py b/test/Java/DerivedSourceTest.py new file mode 100644 index 0000000..c749cf3 --- /dev/null +++ b/test/Java/DerivedSourceTest.py @@ -0,0 +1,124 @@ +#!/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 +# 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. +# + +__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" + +""" +Test of javac.py when building java code from derived sources. + +Original issue definition: +Java emitter for derived sources outputs bogus class files. + +Repeatable with any N-tier, with N > 1, Java derived-source builds where +any of the following conditions are meet: +1. The java class does not belong to the root package. +2. A java source (*.java) creates N targets (*.class) where N > 1. +""" + +import os +import TestSCons +import SCons.Node.FS +import SCons.Defaults + +SCons.Defaults.DefaultEnvironment(tools = []) + +test = TestSCons.TestSCons() + +# No result if tools not available +test.no_result( condition=(test.where_is( 'javac' ) is None) ) +test.no_result( condition=(test.where_is( 'jar' ) is None) ) + +# This test is known to fail as of July 2014; see Tigris issue 1771 and issue 2931. +# Once the underlying issue is corrected, this test should be re-enabled. +test.skip_test('Skipping derived-source test until issue 1771 is fixed.\n') + +test.write( + ['Sample.java'], +""" +// Condition 1: class does not exist in the root package. +package org.sample; + +public class Sample { + // Condition 2: inner class definition causes javac to create + // a second class file. + enum InnerEnum { + stuff, + and, + things + } +} +""" +) + +test.write( + ['SConstruct'], +""" +import os + +env = Environment( + tools = [ + 'javac', + 'jar', + ] +) + +env.Command( + os.path.join( 'org', 'sample', 'Sample.java' ), + 'Sample.java', + Copy( + '$TARGET', + '$SOURCE' + ) +) + +# Copy operation makes the *.java file(s) under org derived-source. +env.Java( + 'build', + 'org' +) +""" +) + +expected = test.wrap_stdout( +build_str = +'''\ +Copy("org/sample/Sample.java", "Sample.java") +javac -d build -sourcepath org/sample org/sample/Sample.java ++-. + +-build + | +-build/org + | +-build/org/sample + | +-build/org/sample/Sample$InnerEnum.class + | +-org/sample/Sample.java + | +-build/org/sample/Sample.class + | +-org/sample/Sample.java + +-org + +-org/sample + +-org/sample/Sample.java +'''.replace( '/', os.sep ) +) + +test.run( arguments = '--tree=derived', stdout = expected ) + +test.up_to_date(arguments = '.') diff --git a/test/Java/RMIC.py b/test/Java/RMIC.py index f88dd14..876ed80 100644 --- a/test/Java/RMIC.py +++ b/test/Java/RMIC.py @@ -94,14 +94,31 @@ line 3 where_javac, java_version = test.java_where_javac() where_rmic = test.java_where_rmic() -test.write("wrapper.py", """\ +# Try to get the major/minor Java version +curver = (1, 0) +if java_version.count('.') == 1: + # Check Java version + major, minor = java_version.split('.') + try: + curver = (int(major), int(minor)) + except: + pass + +# Check the version of the found Java compiler. +# If it's 1.8 or higher, we skip the further RMIC test +# because we'll get warnings about the deprecated API... +# it's just not state-of-the-art anymore. +# Note, how we allow simple version strings like "5" and +# "6" to successfully pass this test. +if curver < (1, 8): + test.write("wrapper.py", """\ import os import sys open('%s', 'ab').write("wrapper.py %%s\\n" %% " ".join(sys.argv[1:])) os.system(" ".join(sys.argv[1:])) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) -test.write('SConstruct', """ + test.write('SConstruct', """ foo = Environment(tools = ['javac', 'rmic'], JAVAC = r'%(where_javac)s', RMIC = r'%(where_rmic)s') @@ -121,15 +138,15 @@ bar_classes = [c for c in bar_classes if str(c).find('Hello') == -1] bar.RMIC(target = Dir('outdir2'), source = bar_classes) """ % locals() ) -test.subdir('com', - ['com', 'other'], - ['com', 'sub'], - ['com', 'sub', 'foo'], - ['com', 'sub', 'bar'], - 'src3a', - 'src3b') - -test.write(['com', 'sub', 'foo', 'Hello.java'], """\ + test.subdir('com', + ['com', 'other'], + ['com', 'sub'], + ['com', 'sub', 'foo'], + ['com', 'sub', 'bar'], + 'src3a', + 'src3b') + + test.write(['com', 'sub', 'foo', 'Hello.java'], """\ package com.sub.foo; import java.rmi.Remote; @@ -140,7 +157,7 @@ public interface Hello extends Remote { } """) -test.write(['com', 'sub', 'foo', 'Example1.java'], """\ + test.write(['com', 'sub', 'foo', 'Example1.java'], """\ package com.sub.foo; import java.rmi.Naming; @@ -179,7 +196,7 @@ public class Example1 extends UnicastRemoteObject implements Hello { } """) -test.write(['com', 'sub', 'foo', 'Example2.java'], """\ + test.write(['com', 'sub', 'foo', 'Example2.java'], """\ package com.sub.foo; import java.rmi.Naming; @@ -218,7 +235,7 @@ public class Example2 extends UnicastRemoteObject implements Hello { } """) -test.write(['com', 'sub', 'bar', 'Hello.java'], """\ + test.write(['com', 'sub', 'bar', 'Hello.java'], """\ package com.sub.bar; import java.rmi.Remote; @@ -229,7 +246,7 @@ public interface Hello extends Remote { } """) -test.write(['com', 'sub', 'bar', 'Example3.java'], """\ + test.write(['com', 'sub', 'bar', 'Example3.java'], """\ package com.sub.bar; import java.rmi.Naming; @@ -268,7 +285,7 @@ public class Example3 extends UnicastRemoteObject implements Hello { } """) -test.write(['com', 'sub', 'bar', 'Example4.java'], """\ + test.write(['com', 'sub', 'bar', 'Example4.java'], """\ package com.sub.bar; import java.rmi.Naming; @@ -307,26 +324,26 @@ public class Example4 extends UnicastRemoteObject implements Hello { } """) -test.run(arguments = '.') - -test.fail_test(test.read('wrapper.out') != "wrapper.py %s -d outdir2 -classpath class2 com.sub.bar.Example3 com.sub.bar.Example4\n" % where_rmic) - -test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Stub.class')) -test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Stub.class')) -test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Stub.class')) -test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Stub.class')) - -# We used to check for _Skel.class files as well, but they're not -# generated by default starting with Java 1.5, and they apparently -# haven't been needed for a while. Don't bother looking, even if we're -# running Java 1.4. If we think they're needed but they don't exist -# the test.up_to_date() call below will detect it. -#test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Skel.class')) -#test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Skel.class')) -#test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Skel.class')) -#test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Skel.class')) - -test.up_to_date(arguments = '.') + test.run(arguments = '.') + + test.fail_test(test.read('wrapper.out') != "wrapper.py %s -d outdir2 -classpath class2 com.sub.bar.Example3 com.sub.bar.Example4\n" % where_rmic) + + test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Stub.class')) + test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Stub.class')) + test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Stub.class')) + test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Stub.class')) + + # We used to check for _Skel.class files as well, but they're not + # generated by default starting with Java 1.5, and they apparently + # haven't been needed for a while. Don't bother looking, even if we're + # running Java 1.4. If we think they're needed but they don't exist + # the test.up_to_date() call below will detect it. + #test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Skel.class')) + #test.must_exist(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example2_Skel.class')) + #test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example3_Skel.class')) + #test.must_exist(test.workpath('outdir2', 'com', 'sub', 'bar', 'Example4_Skel.class')) + + test.up_to_date(arguments = '.') test.pass_test() diff --git a/test/TEX/biblatex_plain.py b/test/TEX/biblatex_plain.py index 740ec66..68f7cc3 100644 --- a/test/TEX/biblatex_plain.py +++ b/test/TEX/biblatex_plain.py @@ -72,7 +72,6 @@ test.run() # All (?) the files we expect will get created in the docs directory files = [ 'biblatextest.aux', - 'biblatextest.bcf', 'biblatextest.blg', 'biblatextest.fls', 'biblatextest.log', |
