summaryrefslogtreecommitdiff
path: root/subplot.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-01-06 11:54:50 +0200
committerLars Wirzenius <liw@liw.fi>2020-01-06 12:02:05 +0200
commita5854b22214b229644014d88a5f5ef9fd7f86d64 (patch)
treed0650eea70c29c11fc74ea23f65d06b25a042e42 /subplot.py
parent8cf12026479d68bc54e846a3d08f84685fc066c1 (diff)
downloadsubplot-a5854b22214b229644014d88a5f5ef9fd7f86d64.tar.gz
Add: progress reporting in generated test program
Diffstat (limited to 'subplot.py')
-rw-r--r--subplot.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/subplot.py b/subplot.py
index e69de29..8e8fa9a 100644
--- a/subplot.py
+++ b/subplot.py
@@ -0,0 +1,30 @@
+def create_file(ctx, filename=None):
+ with open(filename, 'wb') as f:
+ f.write(get_file(filename))
+
+def run_docgen(ctx, md=None, output=None):
+ runcmd(ctx, ['cargo', 'run', '-q', '--bin', 'sp-docgen', md, '-o', output])
+
+def run_codegen(ctx, filename=None):
+ pass
+
+def file_exists(ctx, filename=None):
+ pass
+
+def scenario_was_run(ctx, name=None):
+ pass
+
+def step_was_run(ctx, keyword=None, name=None):
+ pass
+
+def exit_code_zero(ctx):
+ pass
+
+import subprocess
+
+def runcmd(ctx, argv):
+ p = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ stdout, stderr = p.communicate("")
+ ctx['stdout'] = stdout
+ ctx['stderr'] = stderr
+ ctx['exit'] = p.returncode