diff mbox series

[v3] Mark mtrace tests UNSUPPORTED if bug-ga2.mtrace or tst-leaks2.mtrace are missing

Message ID 20201124131209.2877512-1-stli@linux.ibm.com
State New
Headers show
Series [v3] Mark mtrace tests UNSUPPORTED if bug-ga2.mtrace or tst-leaks2.mtrace are missing | expand

Commit Message

Stefan Liebler Nov. 24, 2020, 1:12 p.m. UTC
Starting with commit 29fddfc7dfd6444fa61a256e9a0d0127545e1f2e, the
tests posix/bug-ga2 and resolv/tst-leaks2 are test-container tests.

If test-container.c returns with EXIT_UNSUPPORTED, the tests with
mtrace() are not executed and the mtrace files do not exist.

Therefore the "mtrace-analysis-part" of those tests are marked
UNSUPPORTED if the mtrace files are missing.

Reported-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
 posix/Makefile  | 4 +++-
 resolv/Makefile | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Tulio Magno Quites Machado Filho Nov. 24, 2020, 11 p.m. UTC | #1
Stefan Liebler via Libc-alpha <libc-alpha@sourceware.org> writes:

> Starting with commit 29fddfc7dfd6444fa61a256e9a0d0127545e1f2e, the
> tests posix/bug-ga2 and resolv/tst-leaks2 are test-container tests.
>
> If test-container.c returns with EXIT_UNSUPPORTED, the tests with
> mtrace() are not executed and the mtrace files do not exist.
>
> Therefore the "mtrace-analysis-part" of those tests are marked
> UNSUPPORTED if the mtrace files are missing.
>
> Reported-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>

This patch fixed the issue I had noticed.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>

Thanks!
Stefan Liebler Nov. 25, 2020, 7:37 a.m. UTC | #2
On 11/25/20 12:00 AM, Tulio Magno Quites Machado Filho wrote:
> Stefan Liebler via Libc-alpha <libc-alpha@sourceware.org> writes:
> 
>> Starting with commit 29fddfc7dfd6444fa61a256e9a0d0127545e1f2e, the
>> tests posix/bug-ga2 and resolv/tst-leaks2 are test-container tests.
>>
>> If test-container.c returns with EXIT_UNSUPPORTED, the tests with
>> mtrace() are not executed and the mtrace files do not exist.
>>
>> Therefore the "mtrace-analysis-part" of those tests are marked
>> UNSUPPORTED if the mtrace files are missing.
>>
>> Reported-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
> 
> This patch fixed the issue I had noticed.
> 
> Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
> 
> Thanks!
> 

Committed.
And added comment to "Bug 26821 - Memory leak test failures on Fedora 33"

Thanks,
Stefan
diff mbox series

Patch

diff --git a/posix/Makefile b/posix/Makefile
index fa2d0675cd..4bfc8d942c 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -358,7 +358,9 @@  $(objpfx)tst-getconf.out: tst-getconf.sh $(objpfx)getconf
 	$(evaluate-test)
 
 $(objpfx)bug-ga2-mem.out: $(objpfx)bug-ga2.out
-	$(common-objpfx)malloc/mtrace $(objpfx)bug-ga2.mtrace > $@; \
+	{ test -r $(objpfx)bug-ga2.mtrace \
+	|| ( echo "bug-ga2.mtrace does not exist"; exit 77; ) \
+	&& $(common-objpfx)malloc/mtrace $(objpfx)bug-ga2.mtrace; } > $@; \
 	$(evaluate-test)
 
 bug-ga2-ENV = MALLOC_TRACE=$(objpfx)bug-ga2.mtrace
diff --git a/resolv/Makefile b/resolv/Makefile
index 462c111e13..1cd63445a3 100644
--- a/resolv/Makefile
+++ b/resolv/Makefile
@@ -158,7 +158,9 @@  $(objpfx)mtrace-tst-leaks.out: $(objpfx)tst-leaks.out
 
 tst-leaks2-ENV = MALLOC_TRACE=$(objpfx)tst-leaks2.mtrace
 $(objpfx)mtrace-tst-leaks2.out: $(objpfx)tst-leaks2.out
-	$(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace > $@; \
+	{ test -r $(objpfx)tst-leaks2.mtrace \
+	|| ( echo "tst-leaks2.mtrace does not exist"; exit 77; ) \
+	&& $(common-objpfx)malloc/mtrace $(objpfx)tst-leaks2.mtrace; } > $@; \
 	$(evaluate-test)
 
 tst-resolv-res_ninit-ENV = MALLOC_TRACE=$(objpfx)tst-resolv-res_ninit.mtrace