-
Notifications
You must be signed in to change notification settings - Fork 253
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
Support generating test running code when using dafny translate
#3818
Comments
Related PR that adds support for generating translates tests for Java: #2395 |
I'm in favor of alternative 0 because it scales well. Alternative 2 relies on the subjective choice of which testing framework to choose, and adds extra work for each back-end. |
I'm more in favor with the In addition, the C# compiler currently adds |
Fixes #3818 Fixes #4888 ### Description Add the option `--include-test-runner` to `dafny translate`, to enable getting the results of `dafny test` when doing manual compilation. ### How has this been tested? Updated `RunAllTestsOption.dfy` so it uses this new feature. <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Summary
Add an option
--with-test-runner
todafny translate
so that it generates a main method that runs all the tests, similar to whatdafny test
does.Background and Motivation
Currently Dafny programs can run tests using
dafny test
. However, for Dafny programs that use external code with external dependencies, it might not be possible to compile them usingdafny test
.Proposed Feature
See summary
Alternatives
Alternative 0: by default, let
dafny translate
generate arunTests
file that contains a main method that will run the tests. Generating annotations for a particular target language testing framework, such as is done for C# and XUnit now, will only be done when using a back-end specific option.Alternative 1: Increase the functionality of
dafny test
so that is support builds with external code and external dependencies.Alternative 2: enable
dafny translate
to always generate code for tests that can be executed using a target language testing framework, like is currently done for the C# back-end which generates XUnit tests.The text was updated successfully, but these errors were encountered: