summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2006-02-12 19:56:03 (GMT)
committerSteven Knight <knight@baldmt.com>2006-02-12 19:56:03 (GMT)
commitcb3d0d67affebe678a5ea2b15500d54b0eba25a3 (patch)
tree56208f374c81c91b572cd0fc3cf28223ef80a732 /test
parente12ccf2b9d0e046ff6c4d433d1d093e945e71d33 (diff)
downloadSCons-cb3d0d67affebe678a5ea2b15500d54b0eba25a3.zip
SCons-cb3d0d67affebe678a5ea2b15500d54b0eba25a3.tar.gz
SCons-cb3d0d67affebe678a5ea2b15500d54b0eba25a3.tar.bz2
Add support for Visual Studio 2005 Professional. Windows portability fixes for various tests. (Baptiste Lepilleur)
Diffstat (limited to 'test')
-rw-r--r--test/Java/JAR.py9
-rw-r--r--test/Java/JARCHDIR.py10
-rw-r--r--test/Java/JARFLAGS.py21
-rw-r--r--test/Java/JAVAC.py7
-rw-r--r--test/Java/JAVACFLAGS.py9
-rw-r--r--test/Java/JAVAH.py4
-rw-r--r--test/Java/RMIC.py30
-rw-r--r--test/MSVS/vs-6.0-exec.py2
-rw-r--r--test/MSVS/vs-7.0-exec.py2
-rw-r--r--test/MSVS/vs-7.1-exec.py2
-rw-r--r--test/MSVS/vs-8.0-exec.py6
11 files changed, 69 insertions, 33 deletions
diff --git a/test/Java/JAR.py b/test/Java/JAR.py
index f0e3b3a..1344fb1 100644
--- a/test/Java/JAR.py
+++ b/test/Java/JAR.py
@@ -25,6 +25,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import os.path
import string
import sys
import TestSCons
@@ -146,8 +147,8 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(tools = ['javac', 'jar'],
- JAVAC = '%(where_javac)s',
- JAR = '%(where_jar)s')
+ JAVAC = r'%(where_javac)s',
+ JAR = r'%(where_jar)s')
jar = foo.Dictionary('JAR')
bar = foo.Copy(JAR = r'%(python)s wrapper.py ' + jar)
foo.Java(target = 'classes', source = 'com/sub/foo')
@@ -247,8 +248,10 @@ public class Example6
test.run(arguments = '.')
+expected_wrapper_out = "wrapper.py %(where_jar)s cf bar.jar classes/com/sub/bar\n"
+expected_wrapper_out = string.replace(expected_wrapper_out, '/', os.sep)
test.must_match('wrapper.out',
- "wrapper.py %(where_jar)s cf bar.jar classes/com/sub/bar\n" % locals())
+ expected_wrapper_out % locals())
test.must_exist('foo.jar')
test.must_exist('bar.jar')
diff --git a/test/Java/JARCHDIR.py b/test/Java/JARCHDIR.py
index dedcf4a..3ee3dee 100644
--- a/test/Java/JARCHDIR.py
+++ b/test/Java/JARCHDIR.py
@@ -43,10 +43,18 @@ else:
if not where_javac:
test.skip_test("Could not find Java javac, skipping test(s).\n")
+if test.detect_tool('jar', ENV=ENV):
+ where_jar = test.detect('JAR', 'jar', ENV=ENV)
+else:
+ where_jar = test.where_is('jar')
+if not where_jar:
+ test.skip_test("Could not find Java jar, skipping test(s).\n")
+
test.write('SConstruct', """
dir = 'dist'
env = Environment(tools = ['javac', 'jar'],
- JAVAC = '%(where_javac)s',
+ JAVAC = r'%(where_javac)s',
+ JAR = r'%(where_jar)s',
JARCHDIR = dir)
bin = env.Java(dir, Dir('./'))
jar = env.Jar(File('c.jar', dir), bin)
diff --git a/test/Java/JARFLAGS.py b/test/Java/JARFLAGS.py
index 64eb1a4..3939d98 100644
--- a/test/Java/JARFLAGS.py
+++ b/test/Java/JARFLAGS.py
@@ -24,7 +24,8 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
+import os
+import string
import TestSCons
@@ -44,14 +45,14 @@ if not where_javac:
if test.detect_tool('jar', ENV=ENV):
where_jar = test.detect('JAR', 'jar', ENV=ENV)
else:
- where_javac = test.where_is('jar')
+ where_jar = test.where_is('jar')
if not where_jar:
test.skip_test("Could not find Java jar, skipping test(s).\n")
test.write('SConstruct', """
env = Environment(tools = ['javac', 'jar'],
- JAVAC = '%(where_javac)s',
- JAR = '%(where_jar)s',
+ JAVAC = r'%(where_javac)s',
+ JAR = r'%(where_jar)s',
JARFLAGS = 'cvf')
env['JARFLAGS'] = 'cvf'
class_files = env.Java(target = 'classes', source = 'src')
@@ -72,14 +73,18 @@ public class Example1
}
""")
-test.run(arguments = '.',
- match=TestSCons.match_re_dotall,
- stdout = test.wrap_stdout("""\
+expect = test.wrap_stdout("""\
%(where_javac)s -d classes -sourcepath src src/Example1\.java
%(where_jar)s cvf test.jar classes/src/Example1\.class
.*
adding: classes/src/Example1\.class.*
-""" % locals()))
+""" % locals())
+
+expect = string.replace(expect, '/', os.sep)
+
+test.run(arguments = '.',
+ match=TestSCons.match_re_dotall,
+ stdout = expect)
test.must_exist('test.jar')
diff --git a/test/Java/JAVAC.py b/test/Java/JAVAC.py
index dd09e35..93f0e7b 100644
--- a/test/Java/JAVAC.py
+++ b/test/Java/JAVAC.py
@@ -25,6 +25,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import os.path
import string
import sys
import TestSCons
@@ -113,7 +114,7 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(tools = ['javac'],
- JAVAC = '%s')
+ JAVAC = r'%s')
javac = foo.Dictionary('JAVAC')
bar = foo.Copy(JAVAC = r'%s wrapper.py ' + javac)
foo.Java(target = 'class1', source = 'com/sub/foo')
@@ -285,7 +286,9 @@ class Private {
test.run(arguments = '.')
-test.must_match('wrapper.out', "wrapper.py %s -d class2 -sourcepath com/sub/bar com/sub/bar/Example4.java com/sub/bar/Example5.java com/sub/bar/Example6.java\n" % where_javac)
+expected_wrapper_out = "wrapper.py %s -d class2 -sourcepath com/sub/bar com/sub/bar/Example4.java com/sub/bar/Example5.java com/sub/bar/Example6.java\n"
+expected_wrapper_out = string.replace(expected_wrapper_out, '/', os.sep)
+test.must_match('wrapper.out', expected_wrapper_out % where_javac)
test.must_exist(test.workpath('class1', 'com', 'sub', 'foo', 'Example1.class'))
test.must_exist(test.workpath('class1', 'com', 'other', 'Example2.class'))
diff --git a/test/Java/JAVACFLAGS.py b/test/Java/JAVACFLAGS.py
index a237e91..045fb7b 100644
--- a/test/Java/JAVACFLAGS.py
+++ b/test/Java/JAVACFLAGS.py
@@ -24,7 +24,8 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
-import os.path
+import os
+import string
import TestSCons
@@ -43,7 +44,7 @@ test.subdir('src')
test.write('SConstruct', """
env = Environment(tools = ['javac'],
- JAVAC = '%(where_javac)s',
+ JAVAC = r'%(where_javac)s',
JAVACFLAGS = '-O')
env.Java(target = 'classes', source = 'src')
""" % locals())
@@ -62,8 +63,10 @@ public class Example1
}
""")
+expected_wrapper_out = "%(where_javac)s -O -d classes -sourcepath src src/Example1.java\n"
+expected_wrapper_out = string.replace(expected_wrapper_out, '/', os.sep)
test.run(arguments = '.',
- stdout = test.wrap_stdout("%(where_javac)s -O -d classes -sourcepath src src/Example1.java\n" % locals()))
+ stdout = test.wrap_stdout(expected_wrapper_out % locals()))
test.must_exist(['classes', 'src', 'Example1.class'])
diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py
index d125a06..eb70ac8 100644
--- a/test/Java/JAVAH.py
+++ b/test/Java/JAVAH.py
@@ -123,8 +123,8 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
foo = Environment(tools = ['javac', 'javah'],
- JAVAC = '%(where_javac)s',
- JAVAH = '%(where_javah)s')
+ JAVAC = r'%(where_javac)s',
+ JAVAH = r'%(where_javah)s')
javah = foo.Dictionary('JAVAH')
bar = foo.Copy(JAVAH = r'%(python)s wrapper.py ' + javah)
foo.Java(target = 'class1', source = 'com/sub/foo')
diff --git a/test/Java/RMIC.py b/test/Java/RMIC.py
index 3ce3dec..7ef1359 100644
--- a/test/Java/RMIC.py
+++ b/test/Java/RMIC.py
@@ -92,11 +92,21 @@ line 3
test.fail_test(test.read(['outdir', 'test2.class']) != "test2.JAVA\nline 3\n")
-
-if not os.path.exists('/usr/local/j2sdk1.3.1/bin/rmic'):
- test.skip_test("Could not find Java; skipping non-simulated test(s).\n")
-
-
+ENV = test.java_ENV()
+
+if test.detect_tool('javac', ENV=ENV):
+ where_javac = test.detect('JAVAC', 'javac', ENV=ENV)
+else:
+ where_javac = test.where_is('javac')
+if not where_javac:
+ test.skip_test("Could not find Java javac, skipping non-simulated test(s).\n")
+
+if test.detect_tool('rmic', ENV=ENV):
+ where_rmic = test.detect('JAVAC', 'rmic', ENV=ENV)
+else:
+ where_rmic = test.where_is('rmic')
+if not where_rmic:
+ test.skip_test("Could not find Java rmic, skipping non-simulated test(s).\n")
test.write("wrapper.py", """\
import os
@@ -109,8 +119,8 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
import string
foo = Environment(tools = ['javac', 'rmic'],
- JAVAC = '/usr/local/j2sdk1.3.1/bin/javac',
- RMIC = '/usr/local/j2sdk1.3.1/bin/rmic')
+ JAVAC = r'%(where_javac)s',
+ RMIC = r'%(where_rmic)s')
foo.Java(target = 'class1', source = 'com/sub/foo')
foo.RMIC(target = 'outdir1',
source = ['class1/com/sub/foo/Example1.class',
@@ -118,14 +128,14 @@ foo.RMIC(target = 'outdir1',
JAVACLASSDIR = 'class1')
rmic = foo.Dictionary('RMIC')
-bar = foo.Copy(RMIC = r'%s wrapper.py ' + rmic)
+bar = foo.Copy(RMIC = r'%(python)s wrapper.py ' + rmic)
bar_classes = bar.Java(target = 'class2', source = 'com/sub/bar')
# XXX This is kind of a Python brute-force way to do what Ant
# does with its "excludes" attribute. We should probably find
# a similar friendlier way to do this.
bar_classes = filter(lambda c: string.find(str(c), 'Hello') == -1, bar_classes)
bar.RMIC(target = Dir('outdir2'), source = bar_classes)
-""" % python)
+""" % locals() )
test.subdir('com',
['com', 'other'],
@@ -307,7 +317,7 @@ public class Example4 extends UnicastRemoteObject implements Hello {
test.run(arguments = '.')
-test.fail_test(test.read('wrapper.out') != "wrapper.py /usr/local/j2sdk1.3.1/bin/rmic -d outdir2 -classpath class2 com.sub.bar.Example3 com.sub.bar.Example4\n")
+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.fail_test(not os.path.exists(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Skel.class')))
test.fail_test(not os.path.exists(test.workpath('outdir1', 'com', 'sub', 'foo', 'Example1_Stub.class')))
diff --git a/test/MSVS/vs-6.0-exec.py b/test/MSVS/vs-6.0-exec.py
index a963772..3fe3f16 100644
--- a/test/MSVS/vs-6.0-exec.py
+++ b/test/MSVS/vs-6.0-exec.py
@@ -84,7 +84,7 @@ main(int argc, char *argv)
test.run(chdir='sub dir', arguments='.')
test.run(chdir='sub dir',
- program=['msdev'],
+ program=[test.get_msvs_executable('6.0')],
arguments=['Test.dsp', '/MAKE', 'foo - Win32 Release'])
test.run(program=test.workpath('sub dir', 'foo'), stdout="foo.c\n")
diff --git a/test/MSVS/vs-7.0-exec.py b/test/MSVS/vs-7.0-exec.py
index 8700d41..c4ef414 100644
--- a/test/MSVS/vs-7.0-exec.py
+++ b/test/MSVS/vs-7.0-exec.py
@@ -86,7 +86,7 @@ test.run(chdir='sub dir', arguments='.')
test.vcproj_sys_path(test.workpath('sub dir', 'foo.vcproj'))
test.run(chdir='sub dir',
- program=['devenv'],
+ program=[test.get_msvs_executable('7.0')],
arguments=['foo.sln', '/build', 'Release'])
test.run(program=test.workpath('sub dir', 'foo'), stdout="foo.c\n")
diff --git a/test/MSVS/vs-7.1-exec.py b/test/MSVS/vs-7.1-exec.py
index ea886b2..03fec81 100644
--- a/test/MSVS/vs-7.1-exec.py
+++ b/test/MSVS/vs-7.1-exec.py
@@ -86,7 +86,7 @@ test.run(chdir='sub dir', arguments='.')
test.vcproj_sys_path(test.workpath('sub dir', 'foo.vcproj'))
test.run(chdir='sub dir',
- program=['devenv'],
+ program=[test.get_msvs_executable('7.1')],
arguments=['foo.sln', '/build', 'Release'])
test.run(program=test.workpath('sub dir', 'foo'), stdout="foo.c\n")
diff --git a/test/MSVS/vs-8.0-exec.py b/test/MSVS/vs-8.0-exec.py
index 4554904..f41e2be 100644
--- a/test/MSVS/vs-8.0-exec.py
+++ b/test/MSVS/vs-8.0-exec.py
@@ -85,8 +85,12 @@ test.run(chdir='sub dir', arguments='.')
test.vcproj_sys_path(test.workpath('sub dir', 'foo.vcproj'))
+import SCons.Platform.win32
+system_dll_path = os.path.join( SCons.Platform.win32.get_system_root(), 'System32' )
+os.environ['PATH'] = os.environ['PATH'] + os.pathsep + system_dll_path
+
test.run(chdir='sub dir',
- program=['devenv'],
+ program=[test.get_msvs_executable('8.0')],
arguments=['foo.sln', '/build', 'Release'])
test.run(program=test.workpath('sub dir', 'foo'), stdout="foo.c\n")