File 5383-Improve-test-case-return-value-documentation.patch of Package erlang
From 1d782560ce6abc9c1c38d319122c72fe0a81e4c3 Mon Sep 17 00:00:00 2001
From: Maria Scott <maria-12648430@hnc-agency.org>
Date: Wed, 29 Nov 2023 17:56:04 +0100
Subject: [PATCH 3/4] Improve test case return value documentation
---
.../doc/src/write_test_chapter.xml | 39 +++++++++++++------
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/lib/common_test/doc/src/write_test_chapter.xml b/lib/common_test/doc/src/write_test_chapter.xml
index 6489502e10..569f35b1a5 100644
--- a/lib/common_test/doc/src/write_test_chapter.xml
+++ b/lib/common_test/doc/src/write_test_chapter.xml
@@ -282,17 +282,34 @@
be used. For example: <c>PrivDir = proplists:get_value(priv_dir, Config)</c>.
</p>
- <p>If the test case function crashes, exits purposely or returns <c>{fail,Reason}</c>,
- it is considered <em>failed</em>. If it returns any other value (no matter what value),
- it is considered successful. An exception to this rule is the return value
- <c>{skip,Reason}</c>. If this tuple is returned, the test case is considered
- skipped and is logged as such.</p>
-
- <p>If the test case returns the tuple <c>{comment,Comment}</c>, the case
- is considered successful and <c>Comment</c> is printed in the overview
- log file. This is equal to calling
- <seemfa marker="ct#comment/1"><c>ct:comment(Comment)</c></seemfa>.
- </p>
+ <p>Possible return values of the test case function are:</p>
+ <taglist>
+ <tag><c>{fail, Reason}</c></tag>
+ <item>The test case is considered failed, and the <c>Reason</c>
+ will be logged.</item>
+ <tag><c>{skip, Reason}</c></tag>
+ <item>The test case is considered skipped, and the <c>Reason</c>
+ will be logged.</item>
+ <tag><c>{comment, Comment}</c></tag>
+ <item>The test case is considered successful, and the <c>Comment</c>
+ will be logged.</item>
+ <tag><c>{save_config, SaveConfig}</c></tag>
+ <item>The test case is considered successful, and the <c>SaveConfig</c>
+ will be stored in the <c>Config</c> (see section
+ <seeguide marker="dependencies_chapter#save_config">Saving
+ Configuration Data</seeguide>).</item>
+ <tag><c>{skip_and_save, Reason, SaveConfig}</c></tag>
+ <item>The test case is considered skipped, the <c>Reason</c>
+ will be logged, and the <c>SaveConfig</c> will be stored in the
+ <c>Config</c> (see section
+ <seeguide marker="dependencies_chapter#save_config">Saving
+ Configuration Data</seeguide>).</item>
+ </taglist>
+
+ <p>If the test case function returns any other term, the test case is considered
+ successful.</p>
+
+ <p>If the test case function crashes, it is considered failed.</p>
</section>
--
2.35.3