def test_system_asan_build(self): """Test that options file path is returned inside /system when device is setup with a full-system ASan build.""" test_helpers.patch( self, ["platforms.android.settings.get_sanitizer_tool_name"]) self.mock.get_sanitizer_tool_name.return_value = "asan" self.assertEqual("/system/asan.options", sanitizer.get_options_file_path("asan"))
def test_regular_build(self): """Test that options file path is returned inside device temp dir when device has ASan setup with partial instrumentation using asan_device_setup script.""" test_helpers.patch( self, ["platforms.android.settings.get_sanitizer_tool_name"]) self.mock.get_sanitizer_tool_name.return_value = None self.assertEqual("/data/local/tmp/asan.options", sanitizer.get_options_file_path("asan"))
def test_unsupported(self): """Test that no options file path is returned with an unsupported sanitizer e.g. UBSan, MSan.""" self.assertEqual(None, sanitizer.get_options_file_path("msan")) self.assertEqual(None, sanitizer.get_options_file_path("tsan")) self.assertEqual(None, sanitizer.get_options_file_path("ubsan"))
def test_invalid(self): """Test that no options file path is returned with an invalid sanitizer name.""" self.assertEqual(None, sanitizer.get_options_file_path("invalid"))
def test_regular_build(self): """Test that options file path is returned inside device temp dir when device has ASan setup with partial instrumentation using asan_device_setup script.""" self.assertEqual('/data/local/tmp/asan.options', sanitizer.get_options_file_path('asan'))