Build bionic unit tests for musl
Modify bionic unit tests that are built for glibc so that they also
build against musl. They don't all pass though:
With glibc:
2 SLOW TESTS
4 TIMEOUT TESTS
313 FAILED TESTS
YOU HAVE 2 DISABLED TESTS
With musl:
11 SLOW TESTS
11 TIMEOUT TESTS
363 FAILED TESTS
YOU HAVE 2 DISABLED TESTS
Bug: 190084016
Test: m bionic-unit-tests-glibc with musl
Test: atest bionic-unit-tests-static
Test: atest --host bionic-unit-tests-glibc with glibc
Change-Id: I79b6eab04fed3cc4392450df5eef2579412edfe1
diff --git a/tests/fenv_test.cpp b/tests/fenv_test.cpp
index d495970..ea3f539 100644
--- a/tests/fenv_test.cpp
+++ b/tests/fenv_test.cpp
@@ -170,6 +170,7 @@
}
TEST(fenv, fedisableexcept_fegetexcept) {
+#if !defined(MUSL)
feclearexcept(FE_ALL_EXCEPT);
ASSERT_EQ(0, fetestexcept(FE_ALL_EXCEPT));
@@ -178,9 +179,13 @@
ASSERT_EQ(0, fegetexcept());
ASSERT_EQ(0, feraiseexcept(FE_INVALID));
ASSERT_EQ(FE_INVALID, fetestexcept(FE_ALL_EXCEPT));
+#else
+ GTEST_SKIP() << "musl doesn't have fegetexcept";
+#endif
}
TEST(fenv, feenableexcept_fegetexcept) {
+#if !defined(MUSL)
#if defined(__aarch64__) || defined(__arm__)
// ARM doesn't support this. They used to if you go back far enough, but it was removed in
// the Cortex-A8 between r3p1 and r3p2.
@@ -213,4 +218,7 @@
AssertChildExited(pid, -SIGFPE);
#endif
+#else
+ GTEST_SKIP() << "musl doesn't have fegetexcept";
+#endif
}