diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Java/JAVACCOMSTR.py | 11 | ||||
-rw-r--r-- | test/RCS/implicit.py | 8 | ||||
-rw-r--r-- | test/multi.py | 6 | ||||
-rw-r--r-- | test/pre-post-actions.py | 5 | ||||
-rw-r--r-- | test/scan-once.py | 4 |
5 files changed, 25 insertions, 9 deletions
diff --git a/test/Java/JAVACCOMSTR.py b/test/Java/JAVACCOMSTR.py index 306ae57..7f59e90 100644 --- a/test/Java/JAVACCOMSTR.py +++ b/test/Java/JAVACCOMSTR.py @@ -29,6 +29,8 @@ Test that the $JAVACCOMSTR construction variable allows you to configure the javac output. """ +import os.path + import TestSCons python = TestSCons.python @@ -60,9 +62,14 @@ test.write(['src', 'file1.java'], "file1.java\n/*javac*/\n") test.write(['src', 'file2.java'], "file2.java\n/*javac*/\n") test.write(['src', 'file3.java'], "file3.java\n/*javac*/\n") +classes_src_file1_class = os.path.join('classes', 'src', 'file1.class') +src_file1_java= os.path.join('src', 'file1.java') +src_file2_java= os.path.join('src', 'file2.java') +src_file3_java= os.path.join('src', 'file3.java') + test.run(stdout = test.wrap_stdout("""\ -Compiling class(es) classes/src/file1.class from src/file1.java src/file2.java src/file3.java -""")) +Compiling class(es) %(classes_src_file1_class)s from %(src_file1_java)s %(src_file2_java)s %(src_file3_java)s +""" % locals())) test.must_match(['classes', 'src', 'file1.class'], "file1.java\nfile2.java\nfile3.java\n") diff --git a/test/RCS/implicit.py b/test/RCS/implicit.py index 684a24b..2289258 100644 --- a/test/RCS/implicit.py +++ b/test/RCS/implicit.py @@ -42,6 +42,11 @@ if not ci: print "Could not find `ci' command, skipping test(s)." test.pass_test(1) +co = test.where_is('co') +if not co: + print "Could not find `co' command, skipping test(s)." + test.pass_test(1) + test.subdir('RCS') @@ -66,9 +71,10 @@ test.run(program = ci, stderr = None) test.write('SConstruct', """ +DefaultEnvironment(RCS_CO = r'%s') env = Environment() env.Program('foo.c') -""") +""" % co) test.run(stderr="""\ RCS/foo.c,v --> foo.c diff --git a/test/multi.py b/test/multi.py index 7ae1736..1977679 100644 --- a/test/multi.py +++ b/test/multi.py @@ -28,9 +28,11 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" Test various cases where a target is "built" by multiple builder calls. """ +import os.path +import string + import TestCmd import TestSCons -import os.path test = TestSCons.TestSCons(match=TestCmd.match_re) @@ -173,7 +175,7 @@ test.run(arguments='file4.out', stderr=TestSCons.re_escape(""" scons: warning: Two different environments were specified for target file4.out, but they appear to have the same action: %(python)s build.py \$foo \$TARGET \$SOURCES -""" % {'python':TestSCons.python}) + TestSCons.file_expr) +""" % {'python':string.replace(TestSCons.python, '\\', '\\\\')}) + TestSCons.file_expr) test.must_match('file4.out', "3\nfile4a.in\nfile4b.in\n") diff --git a/test/pre-post-actions.py b/test/pre-post-actions.py index 860ae24..2d8458c 100644 --- a/test/pre-post-actions.py +++ b/test/pre-post-actions.py @@ -28,6 +28,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os +import os.path import stat import sys import TestSCons @@ -162,8 +163,8 @@ env.Command('dir/file', [], build) test.run(chdir = 'work3', arguments = 'dir/file', stdout=test.wrap_stdout("""\ pre(["dir"], []) post(["dir"], []) -build(["dir/file"], []) -""")) +build(["%s"], []) +""" % os.path.join('dir', 'file'))) test.must_match(['work3', 'dir', 'file'], "build()\n") diff --git a/test/scan-once.py b/test/scan-once.py index 4436310..cdacccc 100644 --- a/test/scan-once.py +++ b/test/scan-once.py @@ -96,7 +96,7 @@ test.write(['SLF', 'SConscript'], """\ ### don't seem to work well! ARRGH!!!! ### -experimenttop = "%s" +experimenttop = r"%s" import os import os.path @@ -287,7 +287,7 @@ static_hdrs = "libg_w.h" #exported_hdrs = generated_hdrs + " " + static_hdrs exported_hdrs = static_hdrs lib_name = "g" -lib_fullname = "libg.a" +lib_fullname = env.subst("${LIBPREFIX}g${LIBSUFFIX}") lib_srcs = string.split("libg_1.c libg_2.c libg_3.c") import re lib_objs = map(lambda x: re.sub("\.c$", ".o", x), lib_srcs) |