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

Add CI tests for defmt-test #298

Closed
jonas-schievink opened this issue Dec 3, 2020 · 3 comments · Fixed by #299
Closed

Add CI tests for defmt-test #298

jonas-schievink opened this issue Dec 3, 2020 · 3 comments · Fixed by #299
Labels
difficulty: medium Somewhat difficult to solve good first issue Good for newcomers priority: medium Medium priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: enhancement Enhancement or feature request

Comments

@jonas-schievink
Copy link
Contributor

Who tests the test-runner?

@jonas-schievink jonas-schievink added type: enhancement Enhancement or feature request good first issue Good for newcomers priority: medium Medium priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes difficulty: medium Somewhat difficult to solve labels Dec 3, 2020
@Sh3Rm4n
Copy link
Contributor

Sh3Rm4n commented Dec 9, 2020

If I understand it correctly, this about two possible three test steps:

  1. Check that the generated code is buildable
  2. Introduce proc-macro unit tests which check generated output against expected output
  3. Check if the code can be run (which is difficult for thumb* targets with the CI)

If I have looked up correctly, no CI job is run for defmt-test at the moment, so 1. could be implemented by introducing a CI job.

@japaric
Copy link
Member

japaric commented Dec 9, 2020

now that defmt-test is in the defmt repository it should be possible to run firmware that uses defmt-test in the emulator using qemu-run (or at least I hope that works).

We should check two scenarios: all defmt-test tests pass and one defmt-test test fails; we have firmware tests that panic here. We should also check that the output of defmt-test matches our expectations -- we use snapshot testing for that.

@japaric
Copy link
Member

japaric commented Dec 9, 2020

it should be possible to run firmware that uses defmt-test in the emulator using qemu-run (or at least I hope that works).

those firmware tests / examples live in the firmware/qemu folder.

Adding a new program that uses defmt-test to firmware/qemu/src/bin should cover your point (1).
Listing that program in this script should cover your point (3)

In general, we don't test proc-macro expansion against expected Rust code (your point (2)) in this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium Somewhat difficult to solve good first issue Good for newcomers priority: medium Medium priority for the Knurling team status: needs PR Issue just needs a Pull Request implementing the changes type: enhancement Enhancement or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants