summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-02-05 20:08:29 (GMT)
committerSteven Knight <knight@baldmt.com>2002-02-05 20:08:29 (GMT)
commitf6c20c8f66928d7d9845717cca12770dbfc86a59 (patch)
tree279913aaaa33e5ec28f3699a4a3c894336f56e87 /test
parentac9aa00b71169ab6d275ee6990248e1778bcf456 (diff)
downloadSCons-f6c20c8f66928d7d9845717cca12770dbfc86a59.zip
SCons-f6c20c8f66928d7d9845717cca12770dbfc86a59.tar.gz
SCons-f6c20c8f66928d7d9845717cca12770dbfc86a59.tar.bz2
Make scons return a failure code when a Builder fails (Anthony Roach)
Diffstat (limited to 'test')
-rw-r--r--test/build-errors.py9
-rw-r--r--test/builderrors.py6
-rw-r--r--test/exceptions.py3
-rw-r--r--test/option-i.py3
-rw-r--r--test/option-k.py12
5 files changed, 19 insertions, 14 deletions
diff --git a/test/build-errors.py b/test/build-errors.py
index 694743a..ea129fa 100644
--- a/test/build-errors.py
+++ b/test/build-errors.py
@@ -48,7 +48,8 @@ env.bld(target = 'f1', source = 'f1.in')
test.run(arguments='-f SConstruct1 .',
stdout = "%s f1.in f1\n" % no_such_file,
- stderr = None)
+ stderr = None,
+ status = 2)
bad_command = "Bad command or file name\n"
@@ -84,7 +85,8 @@ env.bld(target = 'f2', source = 'f2.in')
test.run(arguments='-f SConstruct2 .',
stdout = "%s f2.in f2\n" % not_executable,
- stderr = None)
+ stderr = None,
+ status = 2)
test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
if os.name == 'nt':
@@ -107,7 +109,8 @@ env.bld(target = 'f3', source = 'f3.in')
test.run(arguments='-f SConstruct3 .',
stdout = "%s f3.in f3\n" % test.workdir,
- stderr = None)
+ stderr = None,
+ status = 2)
test.description_set("Incorrect STDERR:\n%s\n" % test.stderr())
if os.name == 'nt':
diff --git a/test/builderrors.py b/test/builderrors.py
index ff15610..8a574db 100644
--- a/test/builderrors.py
+++ b/test/builderrors.py
@@ -59,7 +59,7 @@ test.write(['one', 'f2.in'], "one/f2.in\n")
test.write(['one', 'f3.in'], "one/f3.in\n")
test.run(chdir = 'one', arguments = "f1.out f2.out f3.out",
- stderr = "scons: *** [f1.out] Error 1\n")
+ stderr = "scons: *** [f1.out] Error 1\n", status = 2)
test.fail_test(os.path.exists(test.workpath('f1.out')))
test.fail_test(os.path.exists(test.workpath('f2.out')))
@@ -79,7 +79,7 @@ test.write(['two', 'f2.in'], "two/f2.in\n")
test.write(['two', 'f3.in'], "two/f3.in\n")
test.run(chdir = 'two', arguments = "f1.out f2.out f3.out",
- stderr = "scons: *** [f2.out] Error 1\n")
+ stderr = "scons: *** [f2.out] Error 1\n", status = 2)
test.fail_test(test.read(['two', 'f1.out']) != "two/f1.in\n")
test.fail_test(os.path.exists(test.workpath('f2.out')))
@@ -99,7 +99,7 @@ test.write(['three', 'f2.in'], "three/f2.in\n")
test.write(['three', 'f3.in'], "three/f3.in\n")
test.run(chdir = 'three', arguments = "f1.out f2.out f3.out",
- stderr = "scons: *** [f3.out] Error 1\n")
+ stderr = "scons: *** [f3.out] Error 1\n", status = 2)
test.fail_test(test.read(['three', 'f1.out']) != "three/f1.in\n")
test.fail_test(test.read(['three', 'f2.out']) != "three/f2.in\n")
diff --git a/test/exceptions.py b/test/exceptions.py
index 2c6ad2d..acfe9dd 100644
--- a/test/exceptions.py
+++ b/test/exceptions.py
@@ -52,5 +52,6 @@ Traceback \((most recent call|innermost) last\):
File "SConstruct", line 3, in func
raise "func exception"
func exception
-""")
+""", status = 2)
+
test.pass_test()
diff --git a/test/option-i.py b/test/option-i.py
index 6824006..c594563 100644
--- a/test/option-i.py
+++ b/test/option-i.py
@@ -59,7 +59,8 @@ test.write('aaa.in', "aaa.in\n")
test.write('bbb.in', "bbb.in\n")
test.run(arguments = 'aaa.1 aaa.out bbb.1 bbb.out',
- stderr = 'scons: *** [aaa.1] Error 1\n')
+ stderr = 'scons: *** [aaa.1] Error 1\n',
+ status = 2)
test.fail_test(os.path.exists(test.workpath('aaa.1')))
test.fail_test(os.path.exists(test.workpath('aaa.out')))
diff --git a/test/option-k.py b/test/option-k.py
index 14a67b9..51fa6c6 100644
--- a/test/option-k.py
+++ b/test/option-k.py
@@ -58,16 +58,16 @@ test.write('aaa.in', "aaa.in\n")
test.write('bbb.in', "bbb.in\n")
test.run(arguments = 'aaa.out bbb.out',
- stderr =
- 'scons: *** [aaa.1] Error 1\n')
+ stderr = 'scons: *** [aaa.1] Error 1\n',
+ status = 2)
test.fail_test(os.path.exists(test.workpath('aaa.1')))
test.fail_test(os.path.exists(test.workpath('aaa.out')))
test.fail_test(os.path.exists(test.workpath('bbb.out')))
test.run(arguments = '-k aaa.out bbb.out',
- stderr =
- 'scons: *** [aaa.1] Error 1\n')
+ stderr = 'scons: *** [aaa.1] Error 1\n',
+ status = 2)
test.fail_test(os.path.exists(test.workpath('aaa.1')))
test.fail_test(os.path.exists(test.workpath('aaa.out')))
@@ -76,8 +76,8 @@ test.fail_test(test.read('bbb.out') != "succeed.py: bbb.out\n")
test.unlink("bbb.out")
test.run(arguments = '--keep-going aaa.out bbb.out',
- stderr =
- 'scons: *** [aaa.1] Error 1\n')
+ stderr = 'scons: *** [aaa.1] Error 1\n',
+ status = 2)
test.fail_test(os.path.exists(test.workpath('aaa.1')))
test.fail_test(os.path.exists(test.workpath('aaa.out')))