def METHOD_NAME(self):
    """Test that sources are ClangFormat compliant."""
    directories = [
        'include/controller',
        'projects',
        'resources/projects',
        'resources/wren/shaders',
        'tests',
        'include/wren',
        'src/controller/c',
        'src/controller/cpp',
        'src/controller/launcher',
        'src/license/sign',
        'src/webots',
        'src/wren'
    ]
    skippedPaths = [
        'projects/default/controllers/ros/include',
        'projects/robots/gctronic/e-puck/transfer',
        'projects/robots/mobsya/thymio/controllers/thymio2_aseba/aseba',
        'projects/robots/mobsya/thymio/libraries/dashel',
        'projects/robots/mobsya/thymio/libraries/dashel-src',
        'projects/robots/robotis/darwin-op/libraries/libssh',
        'projects/robots/robotis/darwin-op/libraries/libzip',
        'projects/robots/robotis/darwin-op/libraries/robotis-op2/robotis',
        'projects/robots/robotis/darwin-op/remote_control/libjpeg-turbo',
        'projects/vehicles/controllers/ros_automobile/include',
        'src/webots/external'
    ]
    skippedFiles = [
        'projects/robots/robotis/darwin-op/plugins/remote_controls/robotis-op2_tcpip/stb_image.h',
        'src/controller/c/sha1.c',
        'src/controller/c/sha1.h'
    ]
    skippedDirectories = [
        'build',
        'python',
        'java'
    ]
    skippedPathsFull = [os.path.join(self.WEBOTS_HOME, os.path.normpath(path)) for path in skippedPaths]
    skippedFilesFull = [os.path.join(self.WEBOTS_HOME, os.path.normpath(file)) for file in skippedFiles]
    extensions = ['c', 'h', 'cpp', 'hpp', 'cc', 'hh', 'c++', 'h++', 'vert', 'frag']
    modified_files = os.path.join(self.WEBOTS_HOME, 'tests', 'sources', 'modified_files.txt')
    sources = []
    if os.path.isfile(modified_files):
        with open(modified_files, 'r') as file:
            for line in file:
                line = line.strip()
                extension = os.path.splitext(line)[1][1:].lower()
                if extension not in extensions:
                    continue
                found = False
                for directory in directories:
                    if line.startswith(directory):
                        found = True
                        break
                if not found:
                    continue
                found = False
                for directory in skippedPaths + skippedFiles:
                    if line.startswith(directory):
                        found = True
                        break
                if found:
                    continue
                for directory in skippedDirectories:
                    currentDirectories = line.split(os.sep)
                    if directory in currentDirectories:
                        found = True
                if found:
                    continue
                sources.append(os.path.normpath(line))
    else:
        for directory in directories:
            path = os.path.join(self.WEBOTS_HOME, os.path.normpath(directory))
            for rootPath, dirNames, fileNames in os.walk(path):
                shouldContinue = False
                for skippedPath in skippedPathsFull:
                    if rootPath.startswith(skippedPath):
                        shouldContinue = True
                        break
                for directory in skippedDirectories:
                    currentDirectories = rootPath.replace(self.WEBOTS_HOME + os.sep, '').split(os.sep)
                    if directory in currentDirectories:
                        shouldContinue = True
                        break
                if shouldContinue:
                    continue
                for fileName in fileNames:
                    extension = os.path.splitext(fileName)[1][1:].lower()
                    if extension not in extensions:
                        continue
                    path = os.path.normpath(os.path.join(rootPath, fileName))
                    if path not in skippedFilesFull:
                        sources.append(path)
    curdir = os.getcwd()
    os.chdir(self.WEBOTS_HOME)
    for source in sources:
        diff = ''
        with open(source, encoding='utf8') as file:
            try:
                for line in difflib.context_diff(self._runClangFormat(source).decode('utf-8').splitlines(),
                                                 file.read().splitlines()):
                    diff += line + '\n'
            except UnicodeDecodeError:
                self.assertTrue(False, msg='utf-8 decode problem in %s' % source)
            self.assertTrue(
                len(diff) == 0,
                msg='Source file "%s" is not compliant with ClangFormat:\n\nDIFF:%s' % (source, diff)
            )
    os.chdir(curdir)