Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Oct 22, 2024
1 parent 9478a7d commit 89b3099
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 715 deletions.
25 changes: 21 additions & 4 deletions upstream_utils/mrcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import shutil

from upstream_utils import Lib, walk_cwd_and_copy_if
from upstream_utils import Lib, comment_out_invalid_includes, walk_cwd_and_copy_if


def copy_upstream_src(wpilib_root):
Expand All @@ -16,14 +16,23 @@ def copy_upstream_src(wpilib_root):
]:
shutil.rmtree(os.path.join(wpical, d), ignore_errors=True)

walk_cwd_and_copy_if(
lambda dp, f: (f.endswith(".h") or f.endswith(".hh"))
files = walk_cwd_and_copy_if(
lambda dp, f: f.endswith(".h")
and not f.endswith("mrcal-image.h")
and not f.endswith("stereo.h")
and not f.endswith("stereo-matching-libelas.h")
and not dp.startswith(os.path.join(".", "test")),
os.path.join(wpical, "src/main/native/thirdparty/mrcal/include"),
)
walk_cwd_and_copy_if(
for f in files:
comment_out_invalid_includes(
f,
[
os.path.join(wpical, "src/main/native/thirdparty/mrcal/include"),
os.path.join(wpical, "src/main/native/thirdparty/mrcal/generated"),
],
)
files = walk_cwd_and_copy_if(
lambda dp, f: (f.endswith(".c") or f.endswith(".cc") or f.endswith(".pl"))
and not f.endswith("mrcal-pywrap.c")
and not f.endswith("image.c")
Expand All @@ -34,6 +43,14 @@ def copy_upstream_src(wpilib_root):
and not dp.startswith(os.path.join(".", "test")),
os.path.join(wpical, "src/main/native/thirdparty/mrcal/src"),
)
for f in files:
comment_out_invalid_includes(
f,
[
os.path.join(wpical, "src/main/native/thirdparty/mrcal/include"),
os.path.join(wpical, "src/main/native/thirdparty/mrcal/generated"),
],
)


def main():
Expand Down
Loading

0 comments on commit 89b3099

Please sign in to comment.