Add missing conditionals around Linux-specific test code