-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Custom test frameworks #816
Comments
Another point to consider for this is a benchmarking infrastructure. Right now our benchmarking requires writing |
I would like to add an additional use-case: A deeply embedded target like a microcontroller has the following constraints:
Thus a custom test harness is needed. It might have to following properties:
The goals/observations here are:
Thus, for this use case to work, it does not suffice to be able to |
cc me |
One thing that I would love to see is support for test samples. I have a directory with a lot of files that a certain function should be able to process. At the moment, I test this in a single test by enumerating all files and calling the function, but this has several disadvantages:
A framework that can run the same test for multiple inputs, and report progress and ok/fail per input, would be especially useful for regression tests, similar to the compile-fail and compile-pass tests for Rust’s I am not sure what the api would look like. Perhaps something like
|
So I was a little bit tired yesterday. I rephrased my use case above to make it easier to read. If anyone is interested in this, I could devote some more time into working out, how exactly running tests on deeply embedded targets could work and what implications this would have for |
Hi @ekiwi , I'm interested in test framework in deeply embedded targets. But I'm a afraid that we are facing 2 questions here: 1, get Rust run on the board(with or without an RTOS as backend). For the split tests, I think the test framework should define multiple "test targets" such as: "test1", "test2", "test_boot", "test_led" and so on and make different binaries for each target. |
@grissiom cool! I've opened a repository for further discussion, so that we do not have to spam this issue any further.
While there is still some work to be done in order to get programs using only I will try to write some more about the different effort to run rust on micro controllers in the repository mentioned above.
That's what I'm most interested in at the moment. As mentioned above, rust code runs "good enough" on micro controllers to start that work.
That might be a possible solution. However: I really want to stick to the standard rust syntax. If there is some additional functionality, that needs to be added, we should discuss that with the rust community. So @grissiom and anyone else who is interested: feel free to open issues/pull requests on utest-rs! |
I would like to add a feature to the standard test runner, namely:
At the moment, it would seem that I need to make a custom test framework (or fork Cargo) to achieve these goals? |
To integrate into our test system, I need to be able to:
This seems like a fairly small extension on the current test framework; I'm not sure we need much more than that (all the heavy lifting is elsewhere). |
My use case is that I have a directory of test files. Right now I am looping over them in one "test" and reporting errors. This works but has a number of downsides.
Basically I'm recreating a bunch of work that the default test runner already does. Right now I see two work arounds:
Both of which have pretty large downsides. For my use case something as simple as a This is a different approach then @jsgf suggested, as it is extending the test runner rather then replacing it however this seems like a huge enhancement and it doesn't preclude using a custom runner either. Also you can do a custom runner right now on nightly (you can implement your own |
Would something like cargo-test-junit fit into the idea of "test frameworks" you are designing? |
I wrote up a summary of all the discussions I could find about a custom testing framework over at https://users.rust-lang.org/t/past-present-and-future-for-rust-testing/14293. |
As there is currently being discussed in RFC #2318 and in other places, I'm closing this in favor of those places. |
The compiler currently supports the
--test
compiler flag which will create a binary linked to the distributedtest
crate. The crate, however, is quite simplistic. There are a good number of possible extensions to the testing infrastructure which we'd love to have but the internaltest
crate may not be the best place for them.It would be great if the compiler had an interface such that a custom test framework was supported. This could perhaps be a plugin, or it could perhaps be some other custom method. The resulting strategy should likely also have some Cargo integration to make using custom test frameworks as seamless as possible.
Some related topics (feel free to add more!)
The text was updated successfully, but these errors were encountered: