* [LTP] [PATCH] [RFC] doc: Clarify what should be cleaned up at test end
@ 2019-06-17 9:44 Cyril Hrubis
2019-06-17 11:41 ` Jan Stancek
2019-06-17 12:13 ` Petr Vorel
0 siblings, 2 replies; 5+ messages in thread
From: Cyril Hrubis @ 2019-06-17 9:44 UTC (permalink / raw)
To: ltp
This adds a short paragraph that writes down previously unwritten rule
for resource cleanup.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
CC: Jan Stancek <jstancek@redhat.com>
---
doc/test-writing-guidelines.txt | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/doc/test-writing-guidelines.txt b/doc/test-writing-guidelines.txt
index f1912dc12..21223ba03 100644
--- a/doc/test-writing-guidelines.txt
+++ b/doc/test-writing-guidelines.txt
@@ -347,6 +347,14 @@ assigned a valid file descriptor. For most of the things you need to create
extra flag that is set right after successful initialization though. Consider,
for example, test setup below.
+We also prefer cleaning up resources that would otherwise be released on the
+program exit. There are two main reasons for this decision. Resources such as
+file descriptors and mmaped memory could block umounting a block device in
+cases where the test library has mounted a filesystem for the test temporary
+directory. Not freeing allocated memory would upset static analysis and tools
+such as valgrind and produce false-positives when checking for leaks in the
+libc and other low level libraries.
+
[source,c]
-------------------------------------------------------------------------------
static int fd0, fd1, mount_flag;
--
2.19.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [LTP] [PATCH] [RFC] doc: Clarify what should be cleaned up at test end
2019-06-17 9:44 [LTP] [PATCH] [RFC] doc: Clarify what should be cleaned up at test end Cyril Hrubis
@ 2019-06-17 11:41 ` Jan Stancek
2019-06-17 12:55 ` Cyril Hrubis
2019-06-17 12:13 ` Petr Vorel
1 sibling, 1 reply; 5+ messages in thread
From: Jan Stancek @ 2019-06-17 11:41 UTC (permalink / raw)
To: ltp
----- Original Message -----
> This adds a short paragraph that writes down previously unwritten rule
> for resource cleanup.
>
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> CC: Jan Stancek <jstancek@redhat.com>
> ---
> doc/test-writing-guidelines.txt | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/doc/test-writing-guidelines.txt
> b/doc/test-writing-guidelines.txt
> index f1912dc12..21223ba03 100644
> --- a/doc/test-writing-guidelines.txt
> +++ b/doc/test-writing-guidelines.txt
> @@ -347,6 +347,14 @@ assigned a valid file descriptor. For most of the things
> you need to create
> extra flag that is set right after successful initialization though.
> Consider,
> for example, test setup below.
>
> +We also prefer cleaning up resources that would otherwise be released on the
> +program exit. There are two main reasons for this decision. Resources such
> as
> +file descriptors and mmaped memory could block umounting a block device in
> +cases where the test library has mounted a filesystem for the test temporary
> +directory. Not freeing allocated memory would upset static analysis and
> tools
> +such as valgrind and produce false-positives when checking for leaks in the
> +libc and other low level libraries.
> +
I'm OK with the text. Do we leave the paragraph we talked about in style-guide.txt?
> [source,c]
> -------------------------------------------------------------------------------
> static int fd0, fd1, mount_flag;
> --
> 2.19.2
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [LTP] [PATCH] [RFC] doc: Clarify what should be cleaned up at test end
2019-06-17 9:44 [LTP] [PATCH] [RFC] doc: Clarify what should be cleaned up at test end Cyril Hrubis
2019-06-17 11:41 ` Jan Stancek
@ 2019-06-17 12:13 ` Petr Vorel
2019-06-17 13:05 ` Cyril Hrubis
1 sibling, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2019-06-17 12:13 UTC (permalink / raw)
To: ltp
Hi Cyril,
> This adds a short paragraph that writes down previously unwritten rule
> for resource cleanup.
> Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
> CC: Jan Stancek <jstancek@redhat.com>
LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-06-17 13:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-17 9:44 [LTP] [PATCH] [RFC] doc: Clarify what should be cleaned up at test end Cyril Hrubis
2019-06-17 11:41 ` Jan Stancek
2019-06-17 12:55 ` Cyril Hrubis
2019-06-17 12:13 ` Petr Vorel
2019-06-17 13:05 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.