]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Add GCOV flags when necessary.
authorMark Wielaard <mark@klomp.org>
Thu, 11 Jun 2020 17:07:28 +0000 (19:07 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 11 Jun 2020 17:07:28 +0000 (19:07 +0200)
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
tests/Makefile.am

index 99f9da9daa6eb7541999f7895411b6df693e82f4..e5d9196bb2750a338c8050626b33f1742df6acdd 100644 (file)
@@ -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.
index 7db7db1666580c508c887702c44c80f194eb114d..53dd70a7d0366fab8b5722a9f8f3cf6bb01d316b 100644 (file)
@@ -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 \