aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/test.expected-output
diff options
context:
space:
mode:
authorGravatar Michal Sojka <sojkam1@fel.cvut.cz>2010-11-14 22:54:28 +0100
committerGravatar Carl Worth <cworth@cworth.org>2010-11-16 11:28:06 -0800
commitac9dbb47de734afb0ddd4d0b2eb8f5027b1a7f60 (patch)
tree408ad9517cd4d2388909d258a1ecc4975389f5cf /test/test.expected-output
parent75d616c6caa0e0ac51c34371ebee7574dbea2952 (diff)
test: Better handling of stdout and stderr
Git-style tests (test_expect_success etc.) suppress stdout and stderr unless -v is given. Notmuch-style tests (created by test_begin_subtest and test_expect_equal) do not have this behavior so implement it the same. Additionally, for both test styles, the test-lib.sh is changed so that the content of suppressed stdout and stderr is shown in case of failed test. Finally a test for this functionality is added to basic tests.
Diffstat (limited to 'test/test.expected-output')
-rw-r--r--test/test.expected-output/test-verbose-no20
-rw-r--r--test/test.expected-output/test-verbose-yes24
2 files changed, 44 insertions, 0 deletions
diff --git a/test/test.expected-output/test-verbose-no b/test/test.expected-output/test-verbose-no
new file mode 100644
index 00000000..0bca7540
--- /dev/null
+++ b/test/test.expected-output/test-verbose-no
@@ -0,0 +1,20 @@
+test-verbose: Testing the verbosity options of the test framework itself.
+ PASS print something in test_expect_success and pass
+ FAIL print something in test_expect_success and fail
+
+ echo "hello stdout" &&
+ echo "hello stderr" >&2 &&
+ false
+
+hello stdout
+hello stderr
+ PASS print something between test_begin_subtest and test_expect_equal and pass
+ FAIL print something test_begin_subtest and test_expect_equal and fail
+ --- test-verbose.4.expected 2010-11-14 21:41:12.738189710 +0000
+ +++ test-verbose.4.output 2010-11-14 21:41:12.738189710 +0000
+ @@ -1 +1 @@
+ -b
+ +a
+hello stdout
+hello stderr
+
diff --git a/test/test.expected-output/test-verbose-yes b/test/test.expected-output/test-verbose-yes
new file mode 100644
index 00000000..ebe51874
--- /dev/null
+++ b/test/test.expected-output/test-verbose-yes
@@ -0,0 +1,24 @@
+test-verbose: Testing the verbosity options of the test framework itself.
+hello stdout
+hello stderr
+ PASS print something in test_expect_success and pass
+hello stdout
+hello stderr
+ FAIL print something in test_expect_success and fail
+
+ echo "hello stdout" &&
+ echo "hello stderr" >&2 &&
+ false
+
+hello stdout
+hello stderr
+ PASS print something between test_begin_subtest and test_expect_equal and pass
+hello stdout
+hello stderr
+ FAIL print something test_begin_subtest and test_expect_equal and fail
+ --- test-verbose.4.expected 2010-11-14 21:41:06.650023289 +0000
+ +++ test-verbose.4.output 2010-11-14 21:41:06.650023289 +0000
+ @@ -1 +1 @@
+ -b
+ +a
+