summaryrefslogtreecommitdiff
path: root/README.testing
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2011-10-07 17:22:09 +0100
committerRichard Maw <richard.maw@codethink.co.uk>2011-10-10 10:33:12 +0100
commitcdb2882dc33b7bd1ee3fba2190cc17fef324050d (patch)
tree1f06d7dd2c762cf147a7eff3a87473b2968d6edd /README.testing
parentf083ad60f671c0d058668c64ff2bb9ca8fad6fb2 (diff)
downloadtbdiff-cdb2882dc33b7bd1ee3fba2190cc17fef324050d.tar.gz
Added the ability to test the return code of create and deploy
So expected failures can be made by comparing the return code to the expected Also socket tests have been added, add and diff expect create to fail for now The only sensible operation on sockets is to remove them as they need a program to bind them and that program (or a child) needs to be a server So tbdiff should fail if it has to perform such an act. It may be worth having an option to ignore the change, but for now it's better to fail and let the user know why so they can fix it
Diffstat (limited to 'README.testing')
-rw-r--r--README.testing12
1 files changed, 12 insertions, 0 deletions
diff --git a/README.testing b/README.testing
index 0dd1b33..f7c39a4 100644
--- a/README.testing
+++ b/README.testing
@@ -65,3 +65,15 @@ contents and metadata (mtime, ownership and permissions):
check_group $ORG_FILE cdrom && \
check_same_mtime $ORG_FILE $TGT_FILE
}
+
+If either create or deploy should fail then define a test_return function that
+compares the exit code of the program. If it is supposed to fail with a specific
+exit code then check that the codes are equal, if it is just supposed to fail
+then check that it is non-zero
+
+ # create must succeed
+ create_test_return () { test $1 = 0; }
+ # create must fail
+ create_test_return () { test $1 != 0; }
+ # create must fail with error code 1
+ create_test_return () { test $1 = 1; }