enable make check to execute test-suites and skip four testcases in arm

This commit is contained in:
zhangyiru 2021-10-09 06:57:26 -04:00
parent 4c961db064
commit e75a4da048
3 changed files with 95 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: gperftools
Version: 2.8.1
Release: 2
Release: 3
Summary: high-performance malloc and performance analysis tools
License: BSD
@ -8,6 +8,10 @@ URL: https://github.com/gperftools/gperftools
Source0: https://github.com/gperftools/gperftools/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
patch1: gperftools-generic-dynamic-tls.patch
Patch9000: issue-1122-fix-bus-error-on-aarch64.patch
#https://github.com/gperftools/gperftools/issues/1309
Patch9001: skip-arm-in-stacktrace_unittest.patch
#https://github.com/gperftools/gperftools/issues/890
Patch9002: skip-heapchecker-in-arm-arch.patch
BuildRequires: autoconf automake gcc-c++
BuildRequires: libtool libunwind-devel perl-generators
@ -72,6 +76,9 @@ CXXFLAGS=`echo $RPM_OPT_FLAGS -fno-strict-aliasing -Wno-unused-local-typedefs -D
make
%check
LD_LIBRARY_PATH=./.libs make check
%install
%make_install
@ -99,6 +106,11 @@ make
%{_mandir}/man1/*.1.gz
%changelog
* Wed Oct 20 2021 zhangyiru <zhangyiru3@huawei.com> - 2.8.1-3
- enable make check && skip four arm testcases.
the reason is that arm do not have fully functional heap checker and
the calling of unw_step in arm stacktrace_unittest is incorrect, but the function is not affected
* Thu Jul 22 2021 zhangyiru <zhangyiru3@huawei.com> - 2.8.1-2
- remove invalid gdb build dependency

View File

@ -0,0 +1,33 @@
From a4ae4584f8e38fb96ed7adc33231afd19f161e1a Mon Sep 17 00:00:00 2001
From: zhangyiru <zhangyiru3@huawei.com>
Date: Wed, 20 Oct 2021 11:29:09 -0400
Subject: [PATCH] skip-arm-in-stacktrace_unittest
the calling of unw_step in arm stacktrace_unittest is incorrect, but the
function is not affected, so skip it.
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
---
src/tests/stacktrace_unittest.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/tests/stacktrace_unittest.cc b/src/tests/stacktrace_unittest.cc
index 3c9f735..37a90a6 100644
--- a/src/tests/stacktrace_unittest.cc
+++ b/src/tests/stacktrace_unittest.cc
@@ -188,7 +188,12 @@ void ATTRIBUTE_NOINLINE CheckStackTrace(int i) {
//-----------------------------------------------------------------------//
int main(int argc, char ** argv) {
+#if defined(__x86_64__)
CheckStackTrace(0);
printf("PASS\n");
+#else
+ printf("ARM SKIP\n");
+ exit(77);
+#endif
return 0;
}
--
2.27.0

View File

@ -0,0 +1,49 @@
From 0329adf56e817636e4bd19cb980c07f47c481c42 Mon Sep 17 00:00:00 2001
From: zhangyiru <zhangyiru3@huawei.com>
Date: Wed, 20 Oct 2021 11:22:59 -0400
Subject: [PATCH] skip heapchecker in arm arch
arm do not have fully functional heap checker, so skip these three
testcases.
Signed-off-by: zhangyiru <zhangyiru3@huawei.com>
---
src/tests/heap-checker-death_unittest.sh | 5 +++++
src/tests/heap-checker_unittest.sh | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/src/tests/heap-checker-death_unittest.sh b/src/tests/heap-checker-death_unittest.sh
index 69db0c9..deac493 100755
--- a/src/tests/heap-checker-death_unittest.sh
+++ b/src/tests/heap-checker-death_unittest.sh
@@ -34,6 +34,11 @@
# Run the heap checker unittest in a mode where it is supposed to crash and
# return an error if it doesn't.
+arch=$(uname -r | grep x86)
+if [[ $arch == "" ]]; then
+# skip this test, libtool define EXIT_SKIP=77
+ exit 77
+fi
# We expect BINDIR to be set in the environment.
# If not, we set it to some reasonable value.
BINDIR="${BINDIR:-.}"
diff --git a/src/tests/heap-checker_unittest.sh b/src/tests/heap-checker_unittest.sh
index 3c9c0e9..7c27044 100755
--- a/src/tests/heap-checker_unittest.sh
+++ b/src/tests/heap-checker_unittest.sh
@@ -37,6 +37,11 @@
# and heap checker via environment variables. This test makes sure
# they all play well together.
+arch=$(uname -r | grep x86)
+if [[ $arch == "" ]]; then
+# skip this test, libtool define EXIT_SKIP=77
+ exit 77
+fi
# We expect BINDIR and PPROF_PATH to be set in the environment.
# If not, we set them to some reasonable values
BINDIR="${BINDIR:-.}"
--
2.27.0