summaryrefslogtreecommitdiff
path: root/subplot.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-09-27 15:46:54 +0300
committerLars Wirzenius <liw@liw.fi>2020-09-28 10:24:14 +0300
commit7bb1f735423f2f6e0869450aa82b3dcc93799750 (patch)
tree33d21167cfcda3d6ccb9c3dc94fc1d28bfc6baaa /subplot.py
parent5f05798c64c13576340046d0c8f58ca6b6978627 (diff)
downloadsubplot-7bb1f735423f2f6e0869450aa82b3dcc93799750.tar.gz
refactor(subplot.{py,yaml}): use steps/functions from lib/runcmd
Drop the (many) steps and step functions to run Subplot binaries and use the ones from lib/runcmd instead
Diffstat (limited to 'subplot.py')
-rw-r--r--subplot.py103
1 files changed, 0 insertions, 103 deletions
diff --git a/subplot.py b/subplot.py
index 87b6990..f71fa9f 100644
--- a/subplot.py
+++ b/subplot.py
@@ -8,109 +8,6 @@ def install_subplot(ctx):
runcmd_prepend_to_path(ctx, dirname=os.path.join(srcdir, "target", "debug"))
-def try_docgen(ctx, md=None, output=None):
- runcmd_run = globals()["runcmd_run"]
-
- docgen = binary("sp-docgen")
- runcmd_run(ctx, [docgen, md, "-o", output])
-
-
-def run_docgen(ctx, md=None, output=None):
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- try_docgen(ctx, md=md, output=output)
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_docgen_with_date(ctx, md=None, output=None, date=None):
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
- runcmd_run = globals()["runcmd_run"]
-
- docgen = binary("sp-docgen")
- runcmd_run(ctx, [docgen, md, "-o", output, "--date", date])
- runcmd_exit_code_is(ctx, 0)
-
-
-def try_codegen_and_program(ctx, filename=None, testprog=None):
- runcmd_run = globals()["runcmd_run"]
- srcdir = globals()["srcdir"]
-
- codegen = binary("sp-codegen")
- tmpldir = os.path.join(srcdir, "templates")
- runcmd_run(
- ctx, [codegen, filename, "-o", testprog, "--run", "--templates", tmpldir]
- )
-
-
-def run_codegen_and_program(ctx, filename=None, testprog=None):
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
- try_codegen_and_program(ctx, filename=filename, testprog=testprog)
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_codegen(ctx, filename=None, testprog=None):
- runcmd_run = globals()["runcmd_run"]
- srcdir = globals()["srcdir"]
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- codegen = binary("sp-codegen")
- tmpldir = os.path.join(srcdir, "templates")
- runcmd_run(ctx, [codegen, filename, "-o", testprog, "--templates", tmpldir])
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_python_test_program(ctx, testprog=None, pattern=None):
- runcmd_run = globals()["runcmd_run"]
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- runcmd_run(ctx, ["python3", testprog, pattern])
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_bash_test_program(ctx, testprog=None, pattern=None):
- runcmd_run = globals()["runcmd_run"]
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- runcmd_run(ctx, ["bash", testprog, pattern])
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_meta(ctx, filename=None):
- runcmd_run = globals()["runcmd_run"]
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- meta = binary("sp-meta")
- runcmd_run(ctx, [meta, filename])
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_meta_json(ctx, filename=None):
- runcmd_run = globals()["runcmd_run"]
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- meta = binary("sp-meta")
- runcmd_run(ctx, [meta, filename, "-o", "json"])
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_extract(ctx, filename=None, embedded=None, dirname=None):
- runcmd_run = globals()["runcmd_run"]
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- extract = binary("sp-extract")
- runcmd_run(ctx, [extract, filename, embedded, "-o", dirname])
- runcmd_exit_code_is(ctx, 0)
-
-
-def run_pandoc_with_filter(ctx, filename=None, output=None):
- runcmd_run = globals()["runcmd_run"]
- runcmd_exit_code_is = globals()["runcmd_exit_code_is"]
-
- sp_filter = binary("sp-filter")
- runcmd_run(ctx, ["pandoc", "--filter", sp_filter, filename, "-o", output])
- runcmd_exit_code_is(ctx, 0)
-
-
def scenario_was_run(ctx, name=None):
runcmd_stdout_contains = globals()["runcmd_stdout_contains"]
runcmd_stdout_contains(ctx, text="\nscenario: {}\n".format(name))