X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FVppApiCrc.py;h=761059f43ef751ab64371d150562b3aa02f6eb8b;hb=c1ddda9b19f448c6c38ad3705f50b6fffe9cb80e;hp=0cb8c2b7e74d194ec7baff880cd06e120ce43b19;hpb=43bdc7469309d4860bb515056b38714e3a6e6b04;p=csit.git diff --git a/resources/libraries/python/VppApiCrc.py b/resources/libraries/python/VppApiCrc.py index 0cb8c2b7e7..761059f43e 100644 --- a/resources/libraries/python/VppApiCrc.py +++ b/resources/libraries/python/VppApiCrc.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Cisco and/or its affiliates. +# Copyright (c) 2023 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: @@ -380,3 +380,18 @@ class VppApiCrcChecker: if options: self._reported[api_name] = crc logger.console(f"{api_name} used but has options {options}") + + def print_warnings(self): + """Call check_api_name for every API name in surviving collections. + + Useful for VPP CRC checking job. + + Even though there usually is only one surviving collection, + the implementation has to be prepared for multiple collections, + and it should de-duplicate api names. + """ + api_name_to_crc_maps = self._expected.values() + api_name_sets = [set(n2c.keys()) for n2c in api_name_to_crc_maps] + api_names = set().union(*api_name_sets) + for api_name in sorted(api_names): + self.check_api_name(api_name)