Disable SysinfoTest.NominalCPUFrequency on armel/armhf
authorBenjamin Barenblat <bbaren@google.com>
Fri, 25 Feb 2022 01:39:43 +0000 (01:39 +0000)
committerPeter Michael Green <plugwash@raspbian.org>
Fri, 25 Feb 2022 01:39:43 +0000 (01:39 +0000)
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.

Gbp-Pq: Name arm-multiarch.diff

absl/base/internal/sysinfo_test.cc

index 5f9e45f6aa8431ce1343d700d7b8eb90a2ac63c0..9849aac393a11a635d0725a5fbcb6f6a6a2c9420 100644 (file)
@@ -43,7 +43,13 @@ TEST(SysinfoTest, NumCPUs) {
 // 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__)))
+//
+// 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__) || defined(__arm__)))
 TEST(SysinfoTest, NominalCPUFrequency) {
   // Linux only exposes the CPU frequency on certain architectures, and
   // Emscripten doesn't expose it at all.