Ejemplo n.º 1
0
    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"))
Ejemplo n.º 2
0
    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"))
Ejemplo n.º 3
0
 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"))
Ejemplo n.º 4
0
 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"))
Ejemplo n.º 5
0
 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'))