public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED] tests: Add GCOV flags when necessary.
@ 2020-06-11 17:09 Mark Wielaard
  2020-06-11 18:14 ` Martin Liška
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2020-06-11 17:09 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

The nlist-test has a special compile rule, make sure it gets the
GCOV flags when configuring with --enable-gcov.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 tests/ChangeLog   | 4 ++++
 tests/Makefile.am | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/tests/ChangeLog b/tests/ChangeLog
index 99f9da9d..e5d9196b 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,7 @@
+2020-06-11  Mark Wielaard  <mark@klomp.org>
+
+	* Makefile.am (nlist-test): Add GCOV flags when necessary.
+
 2020-06-06  Mark Wielaard  <mark@klomp.org>
 
 	* testfilesyms32.bz2: New test file.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7db7db16..53dd70a7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -80,13 +80,19 @@ backtrace-child-biarch$(EXEEXT): backtrace-child.c
 		     $(AM_LDFLAGS) $(LDFLAGS) $(backtrace_child_LDFLAGS) \
 		     -o $@ $<
 
+if GCOV
+GCOV_FLAGS=-fprofile-arcs -ftest-coverage
+else
+GCOV_FLAGS=
+endif
+
 # test_nlist checks its own symbol table, and expects various symbols
 # to be in the order as specified in the source file. Explicitly set
 # minimal CFLAGS
 test-nlist$(EXEEXT): test-nlist.c
 	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 	  $(AM_CPPFLAGS) $(CPPFLAGS) \
-	  $(test_nlist_CFLAGS) $(test_nlist_LDADD) -o $@ $<
+	  $(test_nlist_CFLAGS) $(GCOV_FLAGS) -o $@ $< $(test_nlist_LDADD)
 
 TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \
 	update1 update2 update3 update4 \
-- 
2.18.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [COMMITTED] tests: Add GCOV flags when necessary.
  2020-06-11 17:09 [COMMITTED] tests: Add GCOV flags when necessary Mark Wielaard
@ 2020-06-11 18:14 ` Martin Liška
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liška @ 2020-06-11 18:14 UTC (permalink / raw)
  To: Mark Wielaard, elfutils-devel

On 6/11/20 7:09 PM, Mark Wielaard wrote:
> +if·GCOV
> +GCOV_FLAGS=-fprofile-arcs·-ftest-coverage
> +else

Hello.

The pair of options can be replaced with --coverage.

Martin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-11 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 17:09 [COMMITTED] tests: Add GCOV flags when necessary Mark Wielaard
2020-06-11 18:14 ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).