summaryrefslogtreecommitdiff
path: root/test/Errors
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-06-08 17:42:45 +0000
committerSteven Knight <knight@baldmt.com>2010-06-08 17:42:45 +0000
commit1fa9386d7ddef1dc68b5cf5209c2ed48eedc24e1 (patch)
tree92768ae428e3972824a7508bd66a96127ce29551 /test/Errors
parentd3ab836d863a1204d0f1ab9d9bfc75890dd43838 (diff)
downloadscons-1fa9386d7ddef1dc68b5cf5209c2ed48eedc24e1.tar.gz
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/Errors')
-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
3 files changed, 41 insertions, 28 deletions
diff --git a/test/Errors/execute-a-directory.py b/test/Errors/execute-a-directory.py
index bf2c2462..55d6844c 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 e51dc85c..db7c88a6 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 1272e818..b9deea12 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)