diff options
author | Benjamin Barenblat <bbaren@google.com> | 2022-03-31 14:13:19 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2022-03-31 14:13:19 -0400 |
commit | 33ef755be756c9699829f33e8ad2eb7072f810d0 (patch) | |
tree | 328c3b3fe0867db29926991ea9bc9cc1bcd1409e /debian/patches | |
parent | 98c32dfeb7a0ad82925d2189f5a5af78f7832aa4 (diff) | |
download | abseil-33ef755be756c9699829f33e8ad2eb7072f810d0.tar.gz abseil-33ef755be756c9699829f33e8ad2eb7072f810d0.tar.bz2 abseil-33ef755be756c9699829f33e8ad2eb7072f810d0.zip |
Disable NominalCPUFrequency tests
Upstream has decided NominalCPUFrequency is for internal consumption,
so stop running its unit tests.
Diffstat (limited to 'debian/patches')
-rw-r--r-- | debian/patches/arm-multiarch.diff | 25 | ||||
-rw-r--r-- | debian/patches/disable-nominalcpufrequency-test.diff | 46 | ||||
-rw-r--r-- | debian/patches/series | 2 |
3 files changed, 47 insertions, 26 deletions
diff --git a/debian/patches/arm-multiarch.diff b/debian/patches/arm-multiarch.diff deleted file mode 100644 index c976f730..00000000 --- a/debian/patches/arm-multiarch.diff +++ /dev/null @@ -1,25 +0,0 @@ -From: Benjamin Barenblat <bbaren@google.com> -Subject: Disable SysinfoTest.NominalCPUFrequency on armel/armhf - -NominalCPUFrequency has different behavior on 32-bit and 64-bit ARM -kernels. The Debian arm64 buildds assume they can build 32-bit ARM -packages, but if they do, the NominalCPUFrequency test will fail. -Disable the test when building for 32-bit ARM. - ---- a/absl/base/internal/sysinfo_test.cc -+++ b/absl/base/internal/sysinfo_test.cc -@@ -43,7 +43,13 @@ - // POWER is particularly problematic here; some Linux kernels expose the CPU - // frequency, while others do not. Since we can't predict a priori what a given - // machine is going to do, just disable this test on POWER on Linux. -+// -+// Debian also disables this test on armel and armhf, since tests for those -+// platforms could either be run on a 32-bit ARM system (where -+// NominalCPUFrequency returns a reasonable value) or a 64-bit ARM system (where -+// it does not). --#if !(defined(__linux) && (defined(__ppc64__) || defined(__PPC64__))) -+#if !(defined(__linux) && \ -+ (defined(__ppc64__) || defined(__PPC64__) || defined(__arm__))) - TEST(SysinfoTest, NominalCPUFrequency) { - // Linux only exposes the CPU frequency on certain architectures, and - // Emscripten doesn't expose it at all. diff --git a/debian/patches/disable-nominalcpufrequency-test.diff b/debian/patches/disable-nominalcpufrequency-test.diff new file mode 100644 index 00000000..dc15dc9e --- /dev/null +++ b/debian/patches/disable-nominalcpufrequency-test.diff @@ -0,0 +1,46 @@ +From: Derek Mauro <dmauro@google.com> +Subject: Remove the test for absl::base_internal::NominalCPUFrequency() from OSS code +Origin: upstream, https://github.com/abseil/abseil-cpp/commit/732b5580f089101ce4b8cdff55bb6461c59a6720 + +Remove the test for absl::base_internal::NominalCPUFrequency() from OSS code + +This is an internal-only function that should never by called by OSS code. +By its nature fails on unsupported platforms. +Google code has tests for this function on supported internal platforms. + +Fixes #1053 + +PiperOrigin-RevId: 408692861 + +--- a/absl/base/internal/sysinfo_test.cc ++++ b/absl/base/internal/sysinfo_test.cc +@@ -37,29 +37,6 @@ + << "NumCPUs() should not have the default value of 0"; + } + +-// Ensure that NominalCPUFrequency returns a reasonable value, or 1.00 on +-// platforms where the CPU frequency is not available through sysfs. +-// +-// POWER is particularly problematic here; some Linux kernels expose the CPU +-// frequency, while others do not. Since we can't predict a priori what a given +-// machine is going to do, just disable this test on POWER on Linux. +-#if !(defined(__linux) && (defined(__ppc64__) || defined(__PPC64__))) +-TEST(SysinfoTest, NominalCPUFrequency) { +- // Linux only exposes the CPU frequency on certain architectures, and +- // Emscripten doesn't expose it at all. +-#if defined(__linux__) && \ +- (defined(__aarch64__) || defined(__hppa__) || defined(__mips__) || \ +- defined(__riscv) || defined(__s390x__)) || \ +- defined(__EMSCRIPTEN__) +- EXPECT_EQ(NominalCPUFrequency(), 1.0) +- << "CPU frequency detection was fixed! Please update unittest."; +-#else +- EXPECT_GE(NominalCPUFrequency(), 1000.0) +- << "NominalCPUFrequency() did not return a reasonable value"; +-#endif +-} +-#endif +- + TEST(SysinfoTest, GetTID) { + EXPECT_EQ(GetTID(), GetTID()); // Basic compile and equality test. + #ifdef __native_client__ diff --git a/debian/patches/series b/debian/patches/series index f68ea75c..6a2a842b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,6 +1,5 @@ configure.diff latomic.diff -arm-multiarch.diff empty-flags-library.diff cordrepring-typo.diff thumb-function-bounds.diff @@ -14,3 +13,4 @@ big-endian-random.diff big-endian-random2.diff big-endian-random3.diff big-endian-random4.diff +disable-nominalcpufrequency-test.diff |