From e59b7faec3d6c1a7bc3df6d8585ff6dbdaaa359d Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Sun, 13 Feb 2022 18:22:36 -0500 Subject: build b3sum automatically in bench.py --- b3sum/bench.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/b3sum/bench.py b/b3sum/bench.py index 73a413c..088bf6a 100755 --- a/b3sum/bench.py +++ b/b3sum/bench.py @@ -1,10 +1,12 @@ #! /usr/bin/env python3 import os +from os import path import subprocess import sys import time +HERE = path.dirname(__file__) NUM_RUNS = 5 @@ -18,7 +20,7 @@ def one_run(): ) start = time.monotonic() subprocess.run( - sys.argv[1:], + [path.join(HERE, "target/release/b3sum")] + sys.argv[1:], stdout=subprocess.DEVNULL, check=True, ) @@ -40,6 +42,11 @@ def median_run(): def main(): + subprocess.run( + ["cargo", "build", "--release"], + check=True, + cwd=HERE, + ) t = median_run() print() print("{:.3f}".format(t)) -- cgit v1.2.3