Disable Wycheproof primality test cases on non-x86 (too slow)
I had hoped outputting regularly would solve things, but one of
Chromium's Android builders is still timing out. Limit it to x86 and
x86_64, which typically is correlated with a more powerful CPU in
downstream CIs.
This isn't great, but we still run non-Wycheproof primality tests and
primality testing doesn't have any dedicated platform-specific assembly.
It does run platform-specific assembly by way of lower-level BIGNUM
operations, but those are also tested elsewhere. bn_mod_u16_consttime
depends on 32-bit vs 64-bit, but that is covered by running on both
32-bit and 64-bit x86.
Use the GTest DISABLED_Foo mechanism so they may still be run manually
with --gtest_also_run_disabled_tests.
Change-Id: Ie422096db5bb4186145532f4fd2d4063372b8988
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/39604
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/fipsmodule/bn/bn_test.cc b/crypto/fipsmodule/bn/bn_test.cc
index 18a7edc..8fb2ed8 100644
--- a/crypto/fipsmodule/bn/bn_test.cc
+++ b/crypto/fipsmodule/bn/bn_test.cc
@@ -2311,7 +2311,14 @@
});
}
-TEST_F(BNTest, WycheproofPrimality) {
+// These tests are very slow, so only enable them on x86 to avoid timing out
+// tests in downstream consumers testing on, e.g., old Android devices.
+#if defined(OPENSSL_X86_64) || defined(OPENSSL_X86)
+#define MAYBE_WycheproofPrimality WycheproofPrimality
+#else
+#define MAYBE_WycheproofPrimality DISABLED_WycheproofPrimality
+#endif
+TEST_F(BNTest, MAYBE_WycheproofPrimality) {
FileTestGTest(
"third_party/wycheproof_testvectors/primality_test.txt",
[&](FileTest *t) {