diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-09-11 21:35:09 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-09-11 21:39:06 +0200 |
commit | c263b3e38c363748667b93f908d596b63d50a96f (patch) | |
tree | 69c40661d76407562c0dbaf840014fc4dec85e20 /misc | |
parent | 204e504d68cd8b5d267d3146390ec2f25c5f2e27 (diff) | |
download | redot-cpp-c263b3e38c363748667b93f908d596b63d50a96f.tar.gz |
Fix get_file_list not returning all generated files.
Adds a CI static check for it.
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/scripts/check_get_file_list.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/misc/scripts/check_get_file_list.py b/misc/scripts/check_get_file_list.py new file mode 100755 index 0000000..cdf6245 --- /dev/null +++ b/misc/scripts/check_get_file_list.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python + +import os, sys + +from pathlib import Path + +sys.path.insert(1, os.path.join(os.path.dirname(__file__), "..", "..")) + +from binding_generator import get_file_list, generate_bindings + +api_filepath = "godot-headers/extension_api.json" +bits = "64" +double = "float" +output_dir = "self_test" + +generate_bindings(api_filepath, use_template_get_node=False, bits=bits, double=double, output_dir=output_dir) +flist = get_file_list(api_filepath, output_dir, headers=True, sources=True) + +p = Path(output_dir) / "gen" +allfiles = [str(f.as_posix()) for f in p.glob("**/*.*")] +missing = list(filter((lambda f: f not in flist), allfiles)) +extras = list(filter((lambda f: f not in allfiles), flist)) +if len(missing) > 0 or len(extras) > 0: + print("Error!") + for f in missing: + print("MISSING: " + str(f)) + for f in extras: + print("EXTRA: " + str(f)) + sys.exit(1) +else: + print("OK!") |