[FEATURE] Improve OS test extendability and readability

Ouverte
#3,258 1 commentaire 2 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
c

Piste de recherche

Commencez par examiner les modules OS Test, en particulier aio.c, ainsi que la prise en charge existante de Unity testing-framework dans NuttX. Comparez la structure actuelle des cas et la sortie de la console avec les conventions de Unity. Done devrait signifier que la suite OS Test possède une structure de cas de test cohérente et lisible, et signale clairement les tests réussis et échoués.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.
Langage dominant
C
Étoiles
474
Forks
807
Merge moyen
1 j 11 h
PR mergées (30 j)
181

Préparer son environnement

  • Aucun Dockerfile ni fichier Docker Compose
  • Propose un modèle de pull request
  • Aucun guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de apache/nuttx-apps

Toutes les issues de apache/nuttx-apps

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.