Skip to content

Commit

Permalink
vision/fair
Browse files Browse the repository at this point in the history
Reviewed By: zsol

Differential Revision: D53258682

fbshipit-source-id: 3f006b5f31a2b1ffdc6323d3a3b08ac46c3162ce
  • Loading branch information
generatedunixname89002005287564 authored and facebook-github-bot committed Jan 31, 2024
1 parent e8d19df commit 4d14ad0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/bm_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
from os.path import basename, dirname, isfile, join


if __name__ == "__main__":
def main() -> None:
if len(sys.argv) > 1:
# Parse from flags.
module_names = [n for n in sys.argv if n.startswith("bm_")] # pyre-ignore
module_names = [n for n in sys.argv if n.startswith("bm_")]
else:
# Get all the benchmark files (starting with "bm_").
bm_files = glob.glob(join(dirname(__file__), "bm_*.py")) # pyre-ignore
bm_files = glob.glob(join(dirname(__file__), "bm_*.py"))
module_names = [
basename(f)[:-3]
for f in bm_files
Expand All @@ -27,3 +27,7 @@
if attr.startswith("bm_"):
print("Running benchmarks for " + module_name + "/" + attr + "...")
getattr(module, attr)()


if __name__ == "__main__":
main() # pragma: no cover

0 comments on commit 4d14ad0

Please sign in to comment.