summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
Diffstat (limited to 'check')
-rwxr-xr-xcheck24
1 files changed, 23 insertions, 1 deletions
diff --git a/check b/check
index 1220ad8..601f900 100755
--- a/check
+++ b/check
@@ -2,6 +2,7 @@
import argparse
import glob
+import json
import os
import sys
import time
@@ -236,8 +237,19 @@ def check_subplots(r):
if os.path.exists(test_log):
os.remove(test_log)
+ bindir = get_bin_dir(r)
+
r.codegen(md, test_py, cwd=dirname)
- p = r.runcmd_unchecked(["python3", test_py, "--log", test_log], cwd=dirname)
+ p = r.runcmd_unchecked(
+ [
+ "python3",
+ test_py,
+ "--log",
+ test_log,
+ f"--env=SUBPLOT_DIR={bindir}",
+ ],
+ cwd=dirname,
+ )
if p.returncode != 0:
if os.path.exists(test_log):
tail(test_log)
@@ -354,6 +366,16 @@ def parse_args():
return p.parse_args()
+def get_bin_dir(r):
+ p = r.runcmd(
+ ["cargo", "metadata", "--format-version=1", "--frozen", "--no-deps"],
+ check=True,
+ stdout=PIPE,
+ )
+ obj = json.loads(p.stdout)
+ return os.path.join(obj["target_directory"], "debug")
+
+
def main():
"""Main program"""
args = parse_args()