Skip to content

ifxfrancois/rust_doc_test_demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Presentation of --document-tests

This repository is a demo of the use case for documentation for tests. Currently we have working proof of concept at https://github.com/Infineon/rust/tree/test_documentation.

see demo

Summary

Add an option to rustdoc/cargo doc for including the documentation of the tests in the generated documentation.

Motivation

During the development of embedded software, Quality or certifications teams need a quick overview of the tests of a project. Typical relevant information are what, how and why a test tests.

  • What would be a short description of the test.
  • How would be a short list of the important tests steps.
  • Why would be references to the relevant detailed architecture or requirements documents.

This information can easily be written as markdown in the documentation of a test function but the current rustdoc/cargo doc excludes all modules and functions marked as #[test] for the generation of the documentation.

Our proposal would be to add a new option to rustdoc/cargo doc which doesn't filter the tests out. Additionally the test functions would be grouped in a paragraph called "Tests" instead of being added to the function paragraph.

As a demonstration the generated doc for the demo are under target/doc. shows the test added to the Test category shows a test documentation with a summary, a list of tests steps, and a link to a requirement

Guide-level explanation

This proposes the new option --document-tests for rustdoc when this option is set:

  • the test modules are not filtered out of the documentation,
  • the test functions are gathered in a category called tests.

For cargo the option --document-tests should run rustdoc with the option --document-tests on the project and on each integration tests and generate a unified documentation.

Build doc with documentation of tests

Limitation of the POC

Integration tests

Currently integration tests are not added to the produced documentation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published