Age | Commit message (Collapse) | Author | Files | Lines |
|
Run "cargo metadata" to get the location of the Cargo "target"
directory. The location of the directory is configurable by the user,
so we can't assume it's "target" in the source tree.
It turned out that running "cargo metadata" in a scenario didn't work
well, because cargo wants to use some files from the user's home
directory, and for scenarios, that's changed (by setting $HOME). To
work around this, the generated test program now requires SUBPLOT_DIR
to be set when running the generated Python test programs. The
"./check" script does that.
Sponsored-by: author
|
|
In order to work on filesystems where the time granularity is not
sub-second, some scenarios need to wait a bit.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
chore: clean up log files from generated Python programs
See merge request larswirzenius/subplot!150
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
This is a step in the right direction, but may not be enough. We'll
see.
Multi-line log messages are no multiple lines in in the log file. All
but the first one are indented.
Dictionaries are listed with one key per line. argv as one item per line.
Various log messages that are just noise removed.
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
In a general sense, we will want to have more than just template
files as resources. This shifts from the concept that the only
thing resource-wise that subplot has is templates, to a more general
shared resources concept without a default path beyond CWD.
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
This allows the tests to add the option to use the templates from the
source tree, and don't use an installed Subplot, or require one to be
installed.
|
|
Drop the (many) steps and step functions to run Subplot binaries and
use the ones from lib/runcmd instead
|
|
This is akin to installing them to a directory in PATH. Instead of
doing that, we amend PATH so that the directory in the source tree
with the binaries are in there. This adds a "given an installed
subplot" step to every scenario that needs to run a Subplot binary.
|
|
Use the Python functions from lib/runcmd.py instead of the ones from
./runcmd.py.
This changes some bindings in subplot.yaml to use functions from
lib/runcmd.py, and changes some step functions in subplot.py to be
defined in terms of functions in lib/runcmd.py. The actual steps in
subplot.md are not changed and no bindings from lib/runcmd.yaml are
yet used.
Some bindings that used to come from runcmd.yaml are here added to
subplot.yaml. This is temporary change that will be undone later by
replacing those bindings with ones from lib/runcmd.yaml, but doing
that in this commit would make it bigger and harder to follow.
|
|
While this module is intended to be inserted into the Subplot Python
template, and it works, it's not cleanly lintable, as the linters
don't understand about the template. Fix this by retrieving any
symbols used from the template via the globals() dict.
|
|
|
|
|
|
|
|
files.{py,yaml} contain re-usable steps for handling files.
runcmd.{py,yaml} contain re-usable steps for running commands and
inspecting results.
|
|
Add acceptance checks for the cleanup functionality, for Python and
Bash templates.
|
|
We use rustfmt for Rust code. Black is the corresponding tool for
Python code.
|
|
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
|
|
|
|
Source files are:
* the markdown file
* the bindings, functions, and bibliography files listed in YAML
metadata
* any included images in the markdown
The template file is not considered: it's only relevant for codegen.
The docgen binary is not considered, either, for now, because reliably
finding the binary is difficult.
|
|
The stdout_matches function in subplot.py was lacking an assert. This
meant all steps checking that stdout contained a desired string
passed, even when they shouldn't have.
I did the original changes sloppily: I should've verified the test
fails with a wrong pattern before finishing the stdout_matches
function.
Also, fix scenarios that were passing because of this, but shouldn't
have been.
Further, fixing this revealed another problem: the way subplot.md was
checking that the simple and regex patterns were working was broken:
they were using a step that looked for specific output to make sure a
nested subplot was calling its function, but doing that in a way that
assumed specific output. This wasn't just broken, but also very
confusing to debug. This commit changes things so the generic stdout
matching step is used instead and is clearer to me.
|
|
This adds scenarios for regex patterns capture and simple pattern
capture from scenario steps, and additionally makes use of simple
patterns everywhere possible in the examples.
|
|
If the output file wouldn't change, then don't update it.
This is imperfect, since it still needs to produce the output file,
so it can spend a bit of processing power to make no changes. But the
alternative would be to make needless changes.
|
|
This is ugly and panics, but that's acceptable for now. We'll clean
this up later.
|
|
|
|
sp-filter already has a test that requires it to work without a title.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|