diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Clang/clang_shared_library.py | 2 | ||||
-rw-r--r-- | test/Clang/clangxx_shared_library.py | 3 | ||||
-rw-r--r-- | test/Command.py | 46 | ||||
-rw-r--r-- | test/Errors/execute-a-directory.py | 6 | ||||
-rw-r--r-- | test/Errors/non-executable-file.py | 6 | ||||
-rw-r--r-- | test/LINK/VersionedLib.py | 12 | ||||
-rw-r--r-- | test/SWIG/recursive-includes-cpp.py | 2 | ||||
-rw-r--r-- | test/option/debug-action-timestamps.py | 10 |
8 files changed, 62 insertions, 25 deletions
diff --git a/test/Clang/clang_shared_library.py b/test/Clang/clang_shared_library.py index 9af3770..83fa4dd 100644 --- a/test/Clang/clang_shared_library.py +++ b/test/Clang/clang_shared_library.py @@ -35,7 +35,7 @@ if not test.where_is('clang'): base = Base() platform = base['PLATFORM'] -if platform == 'posix': +if platform in ['posix', 'sunos']: filename_options = ['foo.os'] libraryname = 'libfoo.so' elif platform == 'darwin': diff --git a/test/Clang/clangxx_shared_library.py b/test/Clang/clangxx_shared_library.py index 6240299..a16be6b 100644 --- a/test/Clang/clangxx_shared_library.py +++ b/test/Clang/clangxx_shared_library.py @@ -44,6 +44,9 @@ elif platform == 'darwin': elif platform == 'win32': filename_options = ['foo.obj','foo.os'] libraryname = 'foo.dll' +elif platform == 'sunos': + filename_options = ['foo.pic.o'] + libraryname = 'libfoo.so' else: test.fail_test() diff --git a/test/Command.py b/test/Command.py index 09a8daa..d8ca86d 100644 --- a/test/Command.py +++ b/test/Command.py @@ -21,7 +21,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__" import TestSCons @@ -43,7 +42,9 @@ test.write('build.py', build_py) test.write(['expand_chdir_sub', 'subbuild.py'], build_py) test.write('SConstruct', """ +from __future__ import print_function import os +import sys def buildIt(env, target, source): with open(str(target[0]), 'w') as f, open(str(source[0]), 'r') as infp: @@ -62,6 +63,18 @@ def sub(env, target, source): t.write(s.read()) return 0 +def source_scanner(node, env, path, builder): + print("Source scanner node=", node, "builder =", builder,file=sys.stderr) + return [] + +def target_scanner(node, env, path, builder): + print("Target scanner node=", node, "builder =", builder,file=sys.stderr) + return [] + +def factory(node,*lst,**kw): + print("factory called on:",node,file=sys.stderr) + return env.File(node) + env = Environment(COPY_THROUGH_TEMP = r'%(_python_)s build.py .tmp $SOURCE' + '\\n' + r'%(_python_)s build.py $TARGET .tmp', EXPAND = '$COPY_THROUGH_TEMP') env.Command(target = 'f1.out', source = 'f1.in', @@ -82,6 +95,19 @@ env.Command(target = 'f7.out', source = 'f7.in', action = r'%(_python_)s build.py $TARGET $SOURCE') Command(target = 'f8.out', source = 'f8.in', action = r'%(_python_)s build.py $TARGET $SOURCE') +env.Command(target = 'f7s.out', source = 'f7.in', + action = r'%(_python_)s build.py $TARGET $SOURCE', + target_scanner=Scanner(lambda node, env, path: target_scanner(node, env, path, "w-env")), + source_scanner=Scanner(lambda node, env, path: source_scanner(node, env, path, "w-env"))) +Command(target = 'f8s.out', source = 'f8.in', + action = r'%(_python_)s build.py $TARGET $SOURCE', + target_scanner=Scanner(lambda node, env, path: target_scanner(node, env, path, "wo-env")), + source_scanner=Scanner(lambda node, env, path: source_scanner(node, env, path, "wo-env"))) +Command(target = 'f8f.out', source = 'f8.in', + action = r'%(_python_)s build.py $TARGET $SOURCE', + target_factory=factory, + source_factory=factory + ) env.Command(target = 'f9.out', source = 'f9.in', action = r'$EXPAND') env.Command(target = '${F10}.out', source = '${F10}.in', @@ -108,7 +134,18 @@ test.write('f9.in', "f9.in\n") test.write('f10.in', "f10.in\n") test.write(['expand_chdir_sub', 'f11.in'], "expand_chdir_sub/f11.in\n") -test.run(arguments = '.') +test_str = r'''factory called on: f8.in +factory called on: f8f.out +Source scanner node= f7.in builder = w-env +Target scanner node= f7s.out builder = w-env +Source scanner node= f8.in builder = wo-env +Target scanner node= f8s.out builder = wo-env +''' + +out = test.run(arguments='.', + stderr=test_str, + match=TestSCons.match_re_dotall) + test.must_match('f1.out', "f1.in\n", mode='r') test.must_match('f2.out', "f2.in\n", mode='r') @@ -118,9 +155,12 @@ test.must_match('f5.out', "XYZZY is set\nf5.in\n", mode='r') test.must_match('f6.out', "f6.in\n", mode='r') test.must_match('f7.out', "f7.in\n", mode='r') test.must_match('f8.out', "f8.in\n", mode='r') +test.must_match('f7s.out', "f7.in\n", mode='r') +test.must_match('f8s.out', "f8.in\n", mode='r') test.must_match('f9.out', "f9.in\n", mode='r') test.must_match('f10.out', "f10.in\n", mode='r') -test.must_match(['expand_chdir_sub', 'f11.out'], "expand_chdir_sub/f11.in\n", mode='r') +test.must_match(['expand_chdir_sub', 'f11.out'], + "expand_chdir_sub/f11.in\n", mode='r') test.pass_test() diff --git a/test/Errors/execute-a-directory.py b/test/Errors/execute-a-directory.py index 95fa7b6..8b6d13b 100644 --- a/test/Errors/execute-a-directory.py +++ b/test/Errors/execute-a-directory.py @@ -65,7 +65,7 @@ scons: \\*\\*\\* \\[%s\\] Error 1 """ cannot_execute = """\ -(sh: )*.+: cannot execute +(sh: )*.+: cannot execute( \\[Is a directory\\])? scons: \\*\\*\\* \\[%s\\] Error %s """ @@ -93,10 +93,6 @@ if os.name == 'nt': konnte_nicht_gefunden_werden % ('f3', 1), unspecified % 'f3' ] -elif sys.platform.find('sunos') != -1: - errs = [ - cannot_execute % ('f3', 1), - ] else: errs = [ cannot_execute % ('f3', 126), diff --git a/test/Errors/non-executable-file.py b/test/Errors/non-executable-file.py index 0e00c77..64c75c6 100644 --- a/test/Errors/non-executable-file.py +++ b/test/Errors/non-executable-file.py @@ -54,7 +54,7 @@ scons: \\*\\*\\* \\[%s\\] Error 1 """ cannot_execute = """\ -(sh: )*.+: cannot execute +(sh: )*.+: cannot execute( \\[Permission denied\\])? scons: \\*\\*\\* \\[%s\\] Error %s """ @@ -88,10 +88,6 @@ if os.name == 'nt': konnte_nicht_gefunden_werden % ('f1', 1), unspecified % 'f1' ] -elif sys.platform.find('sunos') != -1: - errs = [ - cannot_execute % ('f1', 1), - ] else: errs = [ cannot_execute % ('f1', 126), diff --git a/test/LINK/VersionedLib.py b/test/LINK/VersionedLib.py index 468e3e5..64f9b90 100644 --- a/test/LINK/VersionedLib.py +++ b/test/LINK/VersionedLib.py @@ -138,37 +138,37 @@ elif 'sunlink' in tool_list: test_plan = [ { 'libversion' : '2', - 'files' : [ 'libtest.so', 'libtest.so.2', 'so_test.os' ], + 'files' : [ 'libtest.so', 'libtest.so.2', 'test.pic.o' ], 'instfiles' : [ 'libtest.so', 'libtest.so.2' ], 'symlinks' : [ ('libtest.so', 'libtest.so.2') ], }, { 'libversion' : '2.5', - 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5', 'so_test.os' ], + 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5', 'test.pic.o' ], 'instfiles' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5' ], 'symlinks' : [ ('libtest.so', 'libtest.so.2.5'), ('libtest.so.2', 'libtest.so.2.5') ], }, { 'libversion' : '2.5.4', - 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5.4', 'so_test.os' ], + 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5.4', 'test.pic.o' ], 'instfiles' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5.4' ], 'symlinks' : [ ('libtest.so', 'libtest.so.2.5.4'), ('libtest.so.2', 'libtest.so.2.5.4') ], }, { 'libversion' : '2.5.4.7.8', - 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5.4.7.8', 'so_test.os' ], + 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5.4.7.8', 'test.pic.o' ], 'instfiles' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.5.4.7.8' ], 'symlinks' : [ ('libtest.so', 'libtest.so.2.5.4.7.8'), ('libtest.so.2', 'libtest.so.2.5.4.7.8') ], }, { 'libversion' : 'aabf114f', - 'files' : [ 'libtest.so', 'libtest.so.aabf114f', 'so_test.os' ], + 'files' : [ 'libtest.so', 'libtest.so.aabf114f', 'test.pic.o' ], 'instfiles' : [ 'libtest.so', 'libtest.so.aabf114f' ], 'symlinks' : [ ('libtest.so', 'libtest.so.aabf114f') ], }, { 'libversion' : '2.dfffa11', - 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.dfffa11', 'so_test.os' ], + 'files' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.dfffa11', 'test.pic.o' ], 'instfiles' : [ 'libtest.so', 'libtest.so.2', 'libtest.so.2.dfffa11' ], 'symlinks' : [ ('libtest.so', 'libtest.so.2.dfffa11'), ('libtest.so.2', 'libtest.so.2.dfffa11') ], }, diff --git a/test/SWIG/recursive-includes-cpp.py b/test/SWIG/recursive-includes-cpp.py index 3999cc3..dcd9d05 100644 --- a/test/SWIG/recursive-includes-cpp.py +++ b/test/SWIG/recursive-includes-cpp.py @@ -115,6 +115,8 @@ env.SharedLibrary( if sys.platform == 'win32': object_suffix = ".obj" +elif sys.platform == 'sunos5': + object_suffix = ".pic.o" else: object_suffix = ".os" diff --git a/test/option/debug-action-timestamps.py b/test/option/debug-action-timestamps.py index 0277516..059cfdf 100644 --- a/test/option/debug-action-timestamps.py +++ b/test/option/debug-action-timestamps.py @@ -34,13 +34,13 @@ def setup_fixtures(): test.file_fixture('../fixture/SConstruct_test_main.py', 'SConstruct') def test_help_function(): - # Before anything else, make sure we get valid --debug=action_timestamps results + # Before anything else, make sure we get valid --debug=action-timestamps results # when just running the help option. - test.run(arguments = "-h --debug=action_timestamps") + test.run(arguments = "-h --debug=action-timestamps") def build(): # Execute build - test.run(arguments='--debug=action_timestamps') + test.run(arguments='--debug=action-timestamps') build_output = test.stdout() return build_output @@ -84,8 +84,8 @@ def test_correctness_of_timestamps(build_output): debug_time_patterns = [ r'Command execution time: (.*): (\d+\.\d+) seconds', - r'Command execution start time: (.*): (\d+\.\d+) seconds', - r'Command execution stop time: (.*): (\d+\.\d+) seconds' + r'Command execution start timestamp: (.*): (\d+\.\d+)', + r'Command execution end timestamp: (.*): (\d+\.\d+)' ] test = TestSCons.TestSCons() |