[FEATURE] Improve OS test extendability and readability

Aperta
#3,258 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c

Direzione di ricerca

Inizia esaminando i moduli OS Test, in particolare aio.c, e il supporto esistente per Unity testing-framework in NuttX. Confronta la struttura attuale dei casi e l'output della console con le convenzioni di Unity. Done dovrebbe significare che la suite OS Test ha una struttura coerente e leggibile per i casi di test e segnala chiaramente i test superati e falliti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Type: Enhancement
Is your feature request related to a problem? Please describe.

OS Test is the primary testing mechanism for NuttX. It is used on virtually all PRs to check for regressions in kernel code changes, and is also used as a basis for verifying that a new board has successfully gotten NuttX ported and running.

However, the output from OS test is a little cryptic when looking at it for the first time. It is often difficult to determine what tests have been run, what the output means and which tests have even passed/failed. There are many components to OS test, provided by different contributors, and they all have different outputs in the console which lead to more confusion.

It is also difficult to determine what the tests are right away by looking at the code. For instance, the aio.c test file contains a large code block with tests separated by comments that say "Case 1", "Case 2", etc. It requires effort to read and understand, but could be easier.

Describe the solution you'd like

My proposal is that OS Test be re-factored to use the Unity testing framework already supported by NuttX. This is a very lightweight testing framework that provides a structured approach to adding, writing and running test cases, as well as a nice summary output in the console that makes it clear which tests have passed or failed.

Since Unity is lightweight, works well and is supported by NuttX, I think moving to this approach would provide a clearly defined way for devs to add test cases and review the results of running the tests easily. The separated structure of test cases also means it will be easy to look at the test modules like aio.c and determine what tests already exist, what they do and maybe help to identify gaps that could use more tests.

Describe alternatives you've considered

I have considered just re-factoring the tests to have a more unified and structured output in the console, which would improve the ability of judging pass/fail results from logs, but that would require maintaining our own standard and I think it would be more work in the long run. Same for code-structure wise.

Verification
  • I have verified before submitting the report.
Lingua principale
C
Stelle
474
Fork
807
Merge medio
1g 11h
PR unite (30g)
181

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/nuttx-apps

Tutte le issue di apache/nuttx-apps

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.