Giter VIP home page Giter VIP logo

runt's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

thezoq2

runt's Issues

Option to build project before running

It would be nice to have a field in the config to specify how to build a binary. It would look something like this:

[[tests]]
...
build = “cargo build”
...

Runt would run this command once before running all the file tests.

Separating frontend from the executor

There is no reason for runt to tie together the frontend, which is responsible for figuring out which tests need to run, where the expect files are, etc. to the executor, which actually runs the commands in parallel and reports back results. We can use a generic intermediate form to specify which commands need to be executed for which tests:

[
  { "name": "compile:foo/one.txt", "cmd": "cc foo/one.txt", "expect": "foo/one.expect" }
]

The frontend is then responsible for computing these while the executor takes these as input and produces output results.

This will also allow us to connect to other testing frameworks like turnt.

Running tests in parallel causes non-deterministic results

I have two test suites using Verilator. Turns out that there is a race condition caused by two threads trying to read the same file at the same time causing one of them to fail.

make: execvp: obj_dir/Vmain: Text file busy
make: *** [Makefile:19: tests/verilog-primitives/register.vcd] Error 127

I don't know what to do here. The thing I'll do for now is just make a copy of the contended file so that these can be run in parallel. But maybe there should be an option to run a test suite after another finishes?

Allow designation of output filenames

It would be nice if within a runt.toml there was an option to designate an output filename different than the basename of the input file.

As an example
Something like this

[[tests]]
name = "[core] parsing"
# Round-tripping from the compiler should not change anything.
paths = ["./tests/parsing/file1.futil"]
cmd = """
./target/debug/calyx {} -m file -p none -l .
"""
output = "output.futil"

Would output to a file called output.futil instead of file1.expect. The thought is that this might be able to assist in testing multiple steps in a compilation cycle generated from a single source file, as opposed to needing duplicate source files for each step.

For example we could have multiple tests starting from file1.futil.
The first test would check the first step against output.futil
The second test would run the first step then check the output of the second step against output2.futil and so on.

Create directories for expect files if they don't exist

When running runt -s with expect_dir set to a directory that does not exist, the saving will fail and you have to manually create the directory. It would be nice if that was done automatically

I'd be happy to work on this if it is something you're interested in

Run one test from CLI

Maybe use the --only flag to provide a regex and suppress non-matching strings. This would be enough to allow for:

runt --only tests/cat-test/a.txt

and have it run just display the output for that test.

Add a way to get the stem of a filename

For tests where you want to run multiple commands to generate the test output, it would be very convenient to have a way to get the filename without the file extension. I don't exactly know what the syntax would be it would look something like this:

[[tests]]
name = "Verilog tests"
paths = [ "tests/verilog/*.futil" ]
cmd = "./target/debug/futil {}.futil -l ./primitives/std.lib -b verilog | {}.v"

where the command would be replaced with

cmd = "./target/debug/futil tests/verilog/seq.futil -l ./primitives/std.lib -b verilog | tests/verilog/seq.v"

Non-zero exit code on missing

Right now, it seems like only failing tests get a non-zero exit code. However, when running in pre-commit hooks or CI, I would like missing tests to also give a non-zero exit code since it likely means I either forgot to add an expect file, or forgot to check if the missing tests are fine

Allow setup and clean commands

If you want to run a makefile to generate the file to do diff testing on, you are forced to make the command look like:

cmd = "make {} 1>/dev/null 2>/dev/null; cat {}; rm {}"

It would be nice if you could instead do:

setup = "make {}"
cmd = "cat {}"
cleanup = "rm {}"

Eventually, you could imagine automating the cleanup to remove any files generated during the setup command.

Allow suites to stream outputs

With the latest version, at most two suites can run in parallel. Let suites grab locks on the stdout and start dumping out results as they stream in.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.