Only run eventfd tests on Linux.
authorPeter Griess <pgriess@fb.com>
Thu, 26 Sep 2013 14:20:24 +0000 (09:20 -0500)
committerPeter Griess <pgriess@fb.com>
Tue, 15 Oct 2013 01:46:15 +0000 (18:46 -0700)
Summary:
- Detect Linux and define the HAVE_LINUX autoconf macro. Use this to
elide eventfd tests in tests/Makefile.am.

Test Plan:
- fbconfig -r folly && fbmake runtests
- ./configure && make check on Ubuntu/FC/Mac

Reviewed By: delong.j@fb.com

FB internal diff: D998507

folly/configure.ac
folly/test/Makefile.am

index 664c83d5ffd4cc7a3488d59f1a3f5f8c825b5288..6d9fb1e52c91574aa3e11d09b43c4483b4e18909 100644 (file)
@@ -110,6 +110,7 @@ AC_SUBST(AM_LDFLAGS, "$BOOST_LDFLAGS $BOOST_THREAD_LIB $BOOST_SYSTEM_LIB $BOOST_
 
 AM_CONDITIONAL([HAVE_STD_THREAD], [test "$ac_cv_header_features" = "yes"])
 AM_CONDITIONAL([HAVE_X86_64], [test "$build_cpu" = "x86_64"])
+AM_CONDITIONAL([HAVE_LINUX], [test "$build_os" == "linux-gnu"])
 
 # Output
 AC_CONFIG_FILES([Makefile
index 6ec48124a44de2c1687183e62ad12afab7a2ae7d..65cab8a5a396fc9ec836a804b194246666cb2b6b 100644 (file)
@@ -61,8 +61,11 @@ fbstring_test_using_jemalloc_SOURCES = FBStringTest.cpp
 fbstring_test_using_jemalloc_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la
 TESTS += fbstring_test_using_jemalloc
 
+if HAVE_LINUX
 eventfd_test_SOURCES = EventFDTest.cpp
 eventfd_test_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la
+TESTS += eventfd_test
+endif
 
 thread_cached_int_test_SOURCES = ThreadCachedIntTest.cpp
 thread_cached_int_test_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la
@@ -70,7 +73,7 @@ thread_cached_int_test_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark
 thread_local_test_SOURCES = ThreadLocalTest.cpp
 thread_local_test_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la
 
-TESTS += eventfd_test thread_cached_int_test thread_local_test
+TESTS += thread_cached_int_test thread_local_test
 
 fbvector_test_SOURCES = FBVectorTest.cpp
 fbvector_test_LDADD = libgtestmain.la $(top_builddir)/libfollybenchmark.la $(top_builddir)/libfolly.la