Add ifdef to check if BOOST_FOREACH is defined, and disable tests that use it if it is not available