Add support for metadata attributes for enum values (#7567) (#7568)

* Add support for metadata attributes for enum values (#7567)

* Fix path lookup in flatc test

* Try a fix for Windows paths

* Convert path to string to fix Windows error
This commit is contained in:
Piotr Dziwiński
2022-10-07 13:18:00 +13:00
committed by GitHub
parent c92e78a9f8
commit 54418f371b
9 changed files with 195 additions and 46 deletions

View File

@@ -51,6 +51,10 @@ def flatc(options, cwd=script_path):
subprocess.check_call(cmd, cwd=str(cwd))
def reflection_fbs_path():
return Path(root_path).joinpath("reflection", "reflection.fbs")
def make_absolute(filename, path=script_path):
return str(Path(path, filename).absolute())
@@ -67,6 +71,14 @@ def assert_file_doesnt_exists(filename, path=script_path):
return file
def get_file_contents(filename, path=script_path):
file = Path(path, filename)
contents = ""
with open(file) as file:
contents = file.read()
return contents
def assert_file_contains(file, needles):
with open(file) as file:
contents = file.read()