Add Annotations for Monster schema and example buffer

This commit is contained in:
Derek Bailey
2022-04-21 20:43:55 -07:00
parent 0bbfd4b2e3
commit 746c73b910
2 changed files with 6666 additions and 0 deletions

View File

@@ -97,6 +97,12 @@ def flatc_reflection(options, location, target):
shutil.move(str(new_reflection_path), str(original_reflection_path))
shutil.rmtree(str(Path(reflection_path, temp_dir)))
def flatc_annotate(schema, file, include=None, cwd=tests_path):
cmd = [str(flatc_path)]
if include:
cmd += ["-I"] + [include]
cmd += ["--annotate", schema, file]
result = subprocess.run(cmd, cwd=str(cwd), check=True)
# Glob a pattern relative to file path
def glob(path, pattern):
@@ -272,6 +278,19 @@ flatc(
schema="monster_test.fbs",
)
# Generate the annotated binary of the monster_test binary schema.
flatc_annotate(
schema="../reflection/reflection.fbs",
file="monster_test.bfbs",
include="include_test"
)
flatc_annotate(
schema="monster_test.fbs",
file="monsterdata_test.mon",
include="include_test"
)
flatc(
CPP_OPTS
+ NO_INCL_OPTS