summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-06-08 17:42:45 (GMT)
committerSteven Knight <knight@baldmt.com>2010-06-08 17:42:45 (GMT)
commit9dae31a826c6b6f4d85e00447d25cc4b07970305 (patch)
tree92768ae428e3972824a7508bd66a96127ce29551 /test
parentcfa399517220689e5992bf5634ed2dcf366473e2 (diff)
downloadSCons-9dae31a826c6b6f4d85e00447d25cc4b07970305.zip
SCons-9dae31a826c6b6f4d85e00447d25cc4b07970305.tar.gz
SCons-9dae31a826c6b6f4d85e00447d25cc4b07970305.tar.bz2
More Solaris test fixes:
* Different messages and exit codes for errors. * Fix Solaris shared suffixes. * Add a function declaration to some in-line C code to avoid a warning from Sun's compiler. * Make test/Parallel/multiple-parents.py chatty to avoid hangs, and reduce how many times it calls SCons just to make it go a little quicker.
Diffstat (limited to 'test')
-rw-r--r--test/CC/SHCCCOM.py1
-rw-r--r--test/CXX/SHCXXCOM.py1
-rw-r--r--test/Errors/execute-a-directory.py22
-rw-r--r--test/Errors/non-executable-file.py18
-rw-r--r--test/Errors/nonexistent-executable.py29
-rw-r--r--test/Libs/SharedLibraryIxes.py3
-rw-r--r--test/Parallel/multiple-parents.py24
7 files changed, 64 insertions, 34 deletions
diff --git a/test/CC/SHCCCOM.py b/test/CC/SHCCCOM.py
index 0e87b62..006a80e 100644
--- a/test/CC/SHCCCOM.py
+++ b/test/CC/SHCCCOM.py
@@ -54,6 +54,7 @@ else:
test.write('SConstruct', """
env = Environment(SHCCCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+ SHOBJPREFIX='',
SHOBJSUFFIX='.obj')
env.SharedObject(target = 'test1', source = 'test1.c')
env.SharedObject(target = 'test2', source = 'test2%(alt_c_suffix)s')
diff --git a/test/CXX/SHCXXCOM.py b/test/CXX/SHCXXCOM.py
index 0f0940b..7f151ed 100644
--- a/test/CXX/SHCXXCOM.py
+++ b/test/CXX/SHCXXCOM.py
@@ -50,6 +50,7 @@ alt_cpp_suffix=test.get_alt_cpp_suffix()
test.write('SConstruct', """
env = Environment(SHCXXCOM = r'%(_python_)s mycc.py $TARGET $SOURCE',
+ SHOBJPREFIX='',
SHOBJSUFFIX='.obj')
env.SharedObject(target = 'test1', source = 'test1.cpp')
env.SharedObject(target = 'test2', source = 'test2.cc')
diff --git a/test/Errors/execute-a-directory.py b/test/Errors/execute-a-directory.py
index bf2c246..55d6844 100644
--- a/test/Errors/execute-a-directory.py
+++ b/test/Errors/execute-a-directory.py
@@ -25,6 +25,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import sys
import TestSCons
@@ -65,22 +66,22 @@ scons: *** [%s] Error 1
cannot_execute = """\
%s: cannot execute
-scons *** [%s] Error 126
+scons: *** [%s] Error %s
"""
Permission_denied = """\
%s: Permission denied
-scons: *** [%s] Error 126
+scons: *** [%s] Error %s
"""
permission_denied = """\
%s: permission denied
-scons: *** [%s] Error 126
+scons: *** [%s] Error %s
"""
is_a_directory = """\
%s: is a directory
-scons: *** [%s] Error 126
+scons: *** [%s] Error %s
"""
test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
@@ -91,12 +92,17 @@ if os.name == 'nt':
unspecified % 'f3'
]
test.fail_test(not test.stderr() in errs)
+elif sys.platform.find('sunos') != -1:
+ errs = [
+ cannot_execute % ('sh: %s' % test.workdir, 'f3', 1),
+ ]
+ test.fail_test(not test.stderr() in errs)
else:
errs = [
- cannot_execute % (not_executable, 'f3'),
- is_a_directory % (test.workdir, 'f3'),
- Permission_denied % (test.workdir, 'f3'),
- Permission_denied % (test.workdir, 'f3'),
+ cannot_execute % (not_executable, 'f3', 126),
+ is_a_directory % (test.workdir, 'f3', 126),
+ Permission_denied % (test.workdir, 'f3', 126),
+ Permission_denied % (test.workdir, 'f3', 126),
]
test.must_contain_any_line(test.stderr(), errs)
diff --git a/test/Errors/non-executable-file.py b/test/Errors/non-executable-file.py
index e51dc85..db7c88a 100644
--- a/test/Errors/non-executable-file.py
+++ b/test/Errors/non-executable-file.py
@@ -25,6 +25,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import sys
import TestSCons
@@ -54,17 +55,17 @@ scons: *** [%s] Error 1
cannot_execute = """\
%s: cannot execute
-scons *** [%s] Error 126
+scons: *** [%s] Error %s
"""
Permission_denied = """\
%s: Permission denied
-scons: *** [%s] Error 126
+scons: *** [%s] Error %s
"""
permission_denied = """\
%s: permission denied
-scons: *** [%s] Error 126
+scons: *** [%s] Error %s
"""
test.write('SConstruct', r"""
@@ -86,11 +87,16 @@ if os.name == 'nt':
unspecified % 'f1'
]
test.fail_test(not test.stderr() in errs)
+elif sys.platform.find('sunos') != -1:
+ errs = [
+ cannot_execute % ('sh: %s' % not_executable, 'f1', 1),
+ ]
+ test.fail_test(not test.stderr() in errs)
else:
errs = [
- cannot_execute % (not_executable, 'f1'),
- Permission_denied % (not_executable, 'f1'),
- permission_denied % (not_executable, 'f1'),
+ cannot_execute % (not_executable, 'f1', 126),
+ Permission_denied % (not_executable, 'f1', 126),
+ permission_denied % (not_executable, 'f1', 126),
]
test.must_contain_any_line(test.stderr(), errs)
diff --git a/test/Errors/nonexistent-executable.py b/test/Errors/nonexistent-executable.py
index 1272e81..b9deea1 100644
--- a/test/Errors/nonexistent-executable.py
+++ b/test/Errors/nonexistent-executable.py
@@ -25,6 +25,7 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
+import sys
import TestSCons
@@ -61,24 +62,19 @@ internal or external command, operable program or batch file.
scons: *** [%s] Error 1
"""
-not_found_1 = """
+not_found_1_space = """\
sh: %s: not found
-scons: *** [%s] Error 1
+scons: *** [%s] Error %s
"""
-not_found_2 = """
+not_found_2_spaces = """\
sh: %s: not found
-scons: *** [%s] Error 1
-"""
-
-not_found_127 = """\
-sh: %s: not found
-scons: *** [%s] Error 127
+scons: *** [%s] Error %s
"""
No_such = """\
%s: No such file or directory
-scons: *** [%s] Error 127
+scons: *** [%s] Error %s
"""
test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
@@ -89,12 +85,17 @@ if os.name == 'nt':
unspecified % 'f1'
]
test.fail_test(not test.stderr() in errs)
+elif sys.platform.find('sunos') != -1:
+ errs = [
+ not_found_1_space % (no_such_file, 'f1', 1),
+ ]
+ test.fail_test(not test.stderr() in errs)
else:
errs = [
- not_found_1 % (no_such_file, 'f1'),
- not_found_2 % (no_such_file, 'f1'),
- not_found_127 % (no_such_file, 'f1'),
- No_such % (no_such_file, 'f1'),
+ not_found_1_space % (no_such_file, 'f1', 1),
+ not_found_2_spaces % (no_such_file, 'f1', 1),
+ not_found_1_space % (no_such_file, 'f1', 127),
+ No_such % (no_such_file, 'f1', 127),
]
test.must_contain_any_line(test.stderr(), errs)
diff --git a/test/Libs/SharedLibraryIxes.py b/test/Libs/SharedLibraryIxes.py
index c60165a..4e8dbdb 100644
--- a/test/Libs/SharedLibraryIxes.py
+++ b/test/Libs/SharedLibraryIxes.py
@@ -217,6 +217,8 @@ goo(void)
test.write('foo.c', r"""
#include <stdio.h>
+void goo(void);
+
#ifdef _WIN32
#define EXPORT __declspec( dllexport )
#else
@@ -235,6 +237,7 @@ test.write('prog.c', r"""
#include <stdio.h>
void foo(void);
+
int
main(int argc, char *argv[])
{
diff --git a/test/Parallel/multiple-parents.py b/test/Parallel/multiple-parents.py
index 9708961..7fbcb00 100644
--- a/test/Parallel/multiple-parents.py
+++ b/test/Parallel/multiple-parents.py
@@ -28,6 +28,8 @@ Verify that a failed build action with -j works as expected.
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import sys
+
import TestSCons
_python_ = TestSCons._python_
@@ -151,6 +153,10 @@ re_error = """\
re_errors = "(" + re_error + ")+"
+# Make the script chatty so lack of output doesn't fool buildbot into
+# thinking it's hung.
+
+sys.stdout.write('Initial build.\n')
test.run(arguments = 'all',
status = 2,
stderr = "scons: *** [failed19] Error 2\n")
@@ -173,7 +179,8 @@ test.must_exist(test.workpath('prereq19'))
test.must_exist(test.workpath('igreq19'))
-for i in range(5):
+sys.stdout.write('-j8 all\n')
+for i in range(3):
test.run(arguments = '-c all')
test.run(arguments = '-j8 all',
@@ -182,7 +189,8 @@ for i in range(5):
match=TestSCons.match_re_dotall)
-for i in range(5):
+sys.stdout.write('-j 8 -k all\n')
+for i in range(3):
test.run(arguments = '-c all')
test.run(arguments = '-j 8 -k all',
@@ -202,14 +210,16 @@ for i in range(5):
test.must_exist(test.workpath('withSE%02dc' % i))
-for i in range(5):
+sys.stdout.write('all --random\n')
+for i in range(3):
test.run(arguments = 'all --random',
status = 2,
stderr = re_errors,
match=TestSCons.match_re_dotall)
-for i in range(5):
+sys.stdout.write('-j8 --random all\n')
+for i in range(3):
test.run(arguments = '-c all')
test.run(arguments = '-j8 --random all',
@@ -218,7 +228,8 @@ for i in range(5):
match=TestSCons.match_re_dotall)
-for i in range(5):
+sys.stdout.write('-j8 -k --random all\n')
+for i in range(3):
test.run(arguments = '-c all')
test.run(arguments = '-j 8 -k --random all',
@@ -238,7 +249,8 @@ for i in range(5):
test.must_exist(test.workpath('withSE%02dc' % i))
-for i in range(5):
+sys.stdout.write('-j8 -k --random all interupt=yes\n')
+for i in range(3):
test.run(arguments = '-c all')
test.run(arguments = '-j 8 -k --random interrupt=yes all',