Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
tools/api_tests.py | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/tools/api_tests.py b/tools/api_tests.py
index 9e66c92..7f0e3cb 100644
--- a/tools/api_tests.py
+++ b/tools/api_tests.py
@@ -6,36 +6,39 @@ import xml.etree.ElementTree
import sys
-LIBVIRT_API_FILE="/usr/share/libvirt/api/libvirt-api.xml"
+LIBVIRT_API_FILE = "/usr/share/libvirt/api/libvirt-api.xml"
MY_PATH = os.path.dirname(os.path.realpath(__file__))
SRC_PATH = MY_PATH + "/../src"
+
def get_api_symbols(doc):
funcs = doc.iter('function')
macros = doc.iter('macro')
enums = doc.iter('enum')
return funcs, macros, enums
+
def get_sources():
return glob.glob(SRC_PATH + "/*.rs")
+
def match(el, content):
return content.find(el) >= 0
+
def main():
filter_by = ""
if len(sys.argv) > 1:
filter_by = sys.argv[1]
-
+
doc = xml.etree.ElementTree.parse(LIBVIRT_API_FILE).getroot()
implemented = set([])
missing = set([])
for el in doc.iter('function'):
-
- if el.get('name').startswith(filter_by): # What i'm looking for?
-
+ if el.get('name').startswith(filter_by): # What I'm looking for
+
status = False
for source in get_sources():
f = open(source)
@@ -51,13 +54,10 @@ def main():
print("missing:")
for x in missing:
print(x.attrib)
- #print "implemented:"
- #for x in implemented:
- # print x.attrib
-
+ # print "implemented:"
+ # for x in implemented:
+ # print x.attrib
+
if __name__ == '__main__':
main()
-
-
-
--
2.23.0