Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow designation of output filenames #20

Open
nathanielnrn opened this issue Apr 24, 2024 · 7 comments
Open

Allow designation of output filenames #20

nathanielnrn opened this issue Apr 24, 2024 · 7 comments

Comments

@nathanielnrn
Copy link

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.

@rachitnigam
Copy link
Owner

This alone is not sufficient because a test suite will generally have a bunch of different files being tested. What about generalizing the expect_dir stuff to define a template for the name:

expect_template = "dir0/{}-out.futil"

Where {} is replaced with the name of the test. If you just have "dir/out.futil", all files will be tested against that one file.

@ethanuppal
Copy link

What is meant by "name" precisely? Is the name the path? Is it the name in the TOML file?

@nathanielnrn
Copy link
Author

Usually {} refers to whatever is in paths, possibly expanded with wildcards. So paths = ["/dir/*.futil] will run cmd and replace every occurrence of {}with something like dir/file1.futil then dir/file2.futil and so on

@ethanuppal
Copy link

So expect_template = "dir0/{}-out.futil"would expand to "dir0/dir/file1.futil-out.futil"?

@ethanuppal
Copy link

Just want to clarify this before I implement

@nathanielnrn
Copy link
Author

That sounds about right. I recommend you test thi with actual runt invocations. Passing in the -n will output the commands to be run by any tests selected with the -i and -x flags

@ethanuppal
Copy link

Sorry, I just got the notification for this. I'll get on it likely Wednesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants