Ejemplo n.º 1
0
    def testCompilerErrors(self):
        """Runs a list of tests to verify compiler error messages."""

        # Defines a list of test specs, where each element is a tuple
        # (test name, list of regexes for matching the compiler errors).
        test_specs = [('ARENA_PRIVATE_CONSTRUCTOR',
                       [r'calling a protected constructor']), ('SANITY', None)]

        fake_target_util.AssertCcCompilerErrors(
            self,  # The current test case.
            'google3/google/protobuf/arena_nc',  # The fake target file.
            'arena_nc.o',  # The sub-target to build.
            test_specs  # List of test specifications.
        )
Ejemplo n.º 2
0
 def testCompilerErrors(self):
     """Runs a list of tests to verify that erroneous code leads to expected compiler messages."""
     test_specs = [
         ('EXECUTE_MISSING_METHOD_ANNOTATION',
          [r'-Wthread-safety-analysis']),
         ('SUBMIT_MISSING_METHOD_ANNOTATION', [r'-Wthread-safety-analysis'
                                               ]),
         ('SCHEDULE_MISSING_METHOD_ANNOTATION',
          [r'-Wthread-safety-analysis']),
         # Tests that compiling a valid C++ succeeds.
         ('SANITY', None)  # None means that the compilation should succeed.
     ]
     fake_target_util.AssertCcCompilerErrors(
         self, 'google3/platform/public/thread_check_nocompile',
         'thread_check_nocompile.o', test_specs)