Split Up _testsinglephase.c and _testmultiphase.c
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 77.2k
- Forks
- 35.9k
- Métriques de merge des PR
- Métriques de PR en attente
Description
(low priority)
Modules/_testsinglephase.c and Modules/_testmultiphase.c both contain the implementations of multiple modules. We should consider splitting up both files, so each contained module has its own file.
Here are several reasons why this may be worth doing:
- testing with a module hidden in another's .so file is awkward and makes those tests harder to understand
- it's easier to accidentally leak C-module global data between modules when they are implemented in the same file
- when adding a new module, it's trickier (less familiar) to implement it in an existing file than in a new file [^1]
[^1]: However, adding it to an existing file is also simpler in how adding a new file involves tweaking the build. See the devguide.
Furthermore, both files were added to test specific import functionality. As far as I can tell[^2], that never included any need for the multiple-modules-in-one-file approach. However, currently they are the only place where we're testing the feature, regardless of how unintentionally or superficially. gh-124978 targets fixing that lack of explicit testing, including moving away from _testsinglephase.c and _testmultiphase.c (e.g. using the dedicated Modules/_testimportmultiple.c).
[^2]: I personally added Modules/_testsinglephase.c and @encukou added _testmultiphase.c.
All that said, splitting up the files is a fairly low priority task. The status quo isn't ideal but it isn't that bad either.
Here's how I see us taking care of this:
- make sure multiple-modules-in-one-file is tested via the dedicated
Modules/_testimportmultiple.c[^2] (see gh-124978) - create the
Modules/_testsinglephasedirectory - move each module from
_testsinglephase.cto its own file (see the devguide) - update the relevant tests
- delete
Modules/_testsinglephase.c - repeat steps 2-5 for
Modules/_testmultiphase.c
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par examiner Modules/_testsinglephase.c et Modules/_testmultiphase.c, les tests pertinents et gh-124978, puis suivez le workflow extension-module du devguide. Le travail est terminé lorsque le comportement de plusieurs modules est explicitement couvert, que chaque module contenu possède son propre fichier, que les tests pertinents sont mis à jour et que les deux fichiers d’origine sont supprimés.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- c
- Domaine
- build-system, testing
- Type d'issue
- Refactorisation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 45/100