summaryrefslogtreecommitdiff
path: root/0007-add-coverage-compile-option.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2025-09-22 12:52:08 +0000
committerCoprDistGit <infra@openeuler.org>2025-09-22 12:52:08 +0000
commit62193eb291a15f336c66a3e3eb1f95b94fc0d022 (patch)
tree97229163558c23c22ced9d1499e901dd68126bdf /0007-add-coverage-compile-option.patch
parent7572f9f90d38d06d944a23a0f5672962ae7b83b6 (diff)
automatic import of protobuf
Diffstat (limited to '0007-add-coverage-compile-option.patch')
-rw-r--r--0007-add-coverage-compile-option.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/0007-add-coverage-compile-option.patch b/0007-add-coverage-compile-option.patch
new file mode 100644
index 0000000..3e423f9
--- /dev/null
+++ b/0007-add-coverage-compile-option.patch
@@ -0,0 +1,49 @@
+From c87fadf8be81e48697eca3308981ec3a684ecfcc Mon Sep 17 00:00:00 2001
+From: chengzrz <czrzrichard@gmail.com>
+Date: Wed, 16 Nov 2022 17:47:10 +0800
+Subject: [PATCH] protobuf: add coverage compile option
+
+Type:testcode
+reason:add coverage compile option
+
+Signed-off-by: chengzrz <czrzrichard@gmail.com>
+---
+ configure.ac | 7 +++++++
+ src/Makefile.am | 4 ++++
+ 2 files changed, 11 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index eb70a76..2ef1668 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -72,6 +72,13 @@ AC_ARG_WITH([protoc],
+ [use the given protoc command instead of building a new one when building tests (useful for cross-compiling)])],
+ [],[with_protoc=no])
+
++AC_ARG_ENABLE([coverage],
++ [AS_HELP_STRING([--enable-coverage],
++ [generate coverage report])],
++ [coverage=yes],[coverage=no])
++
++AM_CONDITIONAL([HAVE_COVERAGE], [test "x$coverage" == "xyes"])
++
+ # Checks for programs.
+ AC_PROG_CC
+ AC_PROG_CXX
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 9af3db1..81d1418 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -21,6 +21,10 @@ endif
+ PROTOBUF_VERSION = 25:0:0
+ PROTOBUF_OPT_FLAG += -Wl,-z,now -fstack-check
+
++if HAVE_COVERAGE
++PROTOBUF_OPT_FLAG += -fprofile-arcs -ftest-coverage
++endif
++
+ if GCC
+ # Turn on all warnings except for sign comparison (we ignore sign comparison
+ # in Google so our code base have tons of such warnings).
+--
+2.26.3