Check relevant BUILD.gn files for correct gcmole file pattern. The pattern must match the algorithm used in: tools/gcmole/gcmole.py::build_file_list()
| 781 | |
| 782 | |
| 783 | class GCMoleProcessor(SourceFileProcessor): |
| 784 | """Check relevant BUILD.gn files for correct gcmole file pattern. |
| 785 | |
| 786 | The pattern must match the algorithm used in: |
| 787 | tools/gcmole/gcmole.py::build_file_list() |
| 788 | """ |
| 789 | gcmole_re = re.compile('### gcmole(.*)') |
| 790 | arch_re = re.compile('\((.+)\) ###') |
| 791 | |
| 792 | def IsRelevant(self, name): |
| 793 | return True |
| 794 | |
| 795 | def GetPathsToSearch(self): |
| 796 | # TODO(https://crbug.com/v8/12660): These should be directories according |
| 797 | # to the API, but in order to find the toplevel BUILD.gn, we'd need to walk |
| 798 | # the entire project. |
| 799 | return ['BUILD.gn', 'test/cctest/BUILD.gn'] |
| 800 | |
| 801 | def ProcessFiles(self, files): |
| 802 | success = True |
| 803 | for path in files: |
| 804 | with open(path) as f: |
| 805 | gn_file_text = f.read() |
| 806 | for suffix in self.gcmole_re.findall(gn_file_text): |
| 807 | arch_match = self.arch_re.match(suffix) |
| 808 | if not arch_match: |
| 809 | print(f'{path}: Malformed gcmole suffix: {suffix}') |
| 810 | success = False |
| 811 | continue |
| 812 | arch = arch_match.group(1) |
| 813 | if arch not in [ |
| 814 | 'all', 'ia32', 'x64', 'arm', 'arm64', 's390', 'ppc', 'ppc64', |
| 815 | 'mips64', 'mips64el', 'riscv32', 'riscv64', 'loong64' |
| 816 | ]: |
| 817 | print(f'{path}: Unknown architecture for gcmole: {arch}') |
| 818 | success = False |
| 819 | return success |
| 820 | |
| 821 | |
| 822 | def CheckDeps(workspace): |
no test coverage detected
searching dependent graphs…