Projet mkd/pascal.c

De Wiki EELL.

(Différences entre les versions)
m (Ajouté l'entête)
m (Fichiers de la fonction pascal_() : Mise à jour)
 
(3 versions intermédiaires masquées)
Ligne 103 : Ligne 103 :
   The 'Options': n,s,t,v:
   The 'Options': n,s,t,v:
     extern unsigned char n,s,t;
     extern unsigned char n,s,t;
-
     They must be dEfined in the calling function:
+
     They must be defined in the calling function:
     unsigned char n=0,s=0,t=0;
     unsigned char n=0,s=0,t=0;
   With the options:
   With the options:
Ligne 359 : Ligne 359 :
== Fichier de commande des tests ==
== Fichier de commande des tests ==
-
{{Boîte déroulante/début|titre=MAKE_Tests_U}}
+
{{Boîte déroulante/début|titre=MAKE_Tests_U, CLEAN_Tests_U}}
 +
* Fichier MAKE_Tests_U
<pre style color="black">
<pre style color="black">
 +
#!/bin/bash
 +
#O ../../mkd tests under Linux.
 +
#O Epreuve de vérification de la fonction pas_() avec ../../mkd
 +
 +
#O    Copy trinoms.pas in target created file
 +
      cat trinoms.pas > trinoms.tstpas
 +
 +
#O    Test options -nstv with source "trinoms.pas" and target "*.tstpas"
 +
#O    - and screen redirection to tstpas.screen
 +
 +
#O 1: Test de l'option -s append target
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "1: Test de l'option -s append target" >> trinoms.tstpas
 +
      ../../mkd -savP DHOPS trinoms.pas *.tstpas > tstpas.screen
 +
 +
#O 1: Test option -t
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "1: Test option -t" >> trinoms.tstpas
 +
      ../../mkd -tavP DHOPS trinoms.pas *.tstpas # >> tstpas.screen
 +
 +
#O 1: Test option -n, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "1: Test option -n, with append files target and screen" >> trinoms.tstpas
 +
      ../../mkd -navP DHOPS trinoms.pas *.tstpas # >> tstpas.screen
 +
 +
#O 2: Test options -ns, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "2: Test options -ns, with append files target and screen" >> trinoms.tstpas
 +
      ../../mkd -nsavP DHOPS trinoms.pas *.tstpas >> tstpas.screen
 +
 +
#O 2: Test options -nt, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "2: Test options -nt, with append files target and screen" >> trinoms.tstpas
 +
      ../../mkd -ntavP DHOPS trinoms.pas *.tstpas >> tstpas.screen
 +
 +
#O 2: Test options -nst, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> trinoms.tstpas
 +
      echo "2: Test options -nst, with append files target and screen" >> trinoms.tstpas
 +
      ../../mkd -nstavP DHOPS trinoms.pas *.tstpas >> tstpas.screen
 +
 +
#O 5: Independant test with -nstv "trinoms.pas" and target "*.tstpaslastline1"
 +
      ../../mkd -nstvwP S trinoms.pas *.tstpaslastline1 > tstpaslastline.screen1
 +
 +
#O 5: Independant test with -nstv "trinomsc2" and target file "*.tstpaslastline2"
 +
      ../../mkd -nstvwP DHOPS trinoms2.pas trinoms.tstpaslastblock > tstpaslastblock.screen2 #w bug ?
 +
 +
#O 5: Independant test with -nstv "trinomsc3" and target file "*.tstpaslastline2"
 +
      ../../mkd -nstvaP DHOPS trinoms3.pas trinoms.tstpaslastblock >> tstpaslastblock.screen2 #w bug ?
 +
 +
#O 5: Independant test with -nstv "trinomsc4" and target file "*.tstpaslastline2"
 +
      ../../mkd -nstvaP DHOPS trinoms4.pas trinoms.tstpaslastblock >> tstpaslastblock.screen2 #w bug ?
 +
 +
 +
#O    Break with gedit "trinoms.tstpas", "tstpas.screen"
 +
      gedit trinoms.tstpas tstpas.screen trinoms.tstpaslastline1 tstpaslastline.screen1 trinoms.tstpaslastblock tstpaslastblock.screen2
 +
 +
#w bug      gedit trinoms.pas.tstpaslastline2 #bug in version < 2012
 +
 +
#O    Erase trinoms.tstpas
 +
</pre>
 +
 +
* Fichier CLEAN_Tests_U
 +
<pre>
 +
#!/bin/bash
 +
#O File Tests_Clean
 +
#O Force delete files created with mkd "tests" under Linux.
 +
      rm -f trinoms.tstpas
 +
      rm -f tstpas.screen
 +
      rm -f trinoms.tstpaslastline1
 +
      rm -f tstpaslastline.screen1
 +
      rm -f trinoms.tstpaslastblock
 +
      rm -f tstpaslastblock.screen2
 +
      rm -f *.doc
</pre>
</pre>
{{Boîte déroulante/fin}}
{{Boîte déroulante/fin}}
-
 
== Analyse des tests konsole ==
== Analyse des tests konsole ==
Ligne 369 : Ligne 444 :
{{Boîte déroulante/début|titre=Analysis 2013-05-07}}
{{Boîte déroulante/début|titre=Analysis 2013-05-07}}
<pre style color="black">
<pre style color="black">
 +
Fichier Analysis texte UTF-8
 +
Analyse du : 7 mai 2013 par Clara pour le retour à la conception détaillée.
 +
-------------------------------------------------------------------------------
 +
Résultats du test unitaire de la fonction pascal_() du fichier pascal.c
 +
intégrée à la commande mkd 2013: version alpha
 +
.
 +
Ce test est effectué avec la version mkd 2013 alpha pour évaluer les
 +
modifications à effectuer dans cette même version.
 +
.
 +
    D'après les directives et les fichiers d'analyse trinoms.tstpas,
 +
    tstpas.screen, trinoms.tstlasline1, tstlaslinescreen1, trinom.tstlastbloc
 +
    tstlastblock.screen2
 +
.
 +
    Directives de tests unitaires version alpha 2013:
 +
    -------------------------------------------------
 +
1:  Vérifiez les options n, s et t séparément:
 +
    - les essais séparés fonctionnent correctement et sont conformes
 +
.
 +
2:  Vérifiez que la numérotation des lignes est correcte dans tous les cas de
 +
    décodage (lignes et blocs). n, ns. nt, nst.
 +
    - Les essais réalisés ont été conformes
 +
.
 +
3:  Vérifiez que le texte reste à la bonne place dans tous les cas de décodage:
 +
    toute la ligne (dans la cas de la directive de compilation FULL_LINE), ou
 +
    texte seul.
 +
    - Le résultat est conforme (Sans de numérotation des lignes)
 +
.
 +
4:  -- Vérifiez que les tabulations sont bien prises en charge.
 +
    -- Vérifiez de même pour les espaces.
 +
    - Les résultas sont conformes. Il est à noter que les tabulations créent un
 +
      décalage du texte avec l'option -n numéroation
 +
.
 +
5:  La fonction doit être éprouvée de telle sorte qu'un commentaire qui se
 +
    termine par le caractère de fin de fichier soit entièrement copié dans le
 +
    fichier cible.
 +
    Le caractère de fin de fichier décodé avant le(les) caractère(s) de fin de
 +
    commentaire doit être remplacé par un caractère de fin de ligne 0xOA.
 +
    - Le fichier test des blocs, fait apparaîre des résultats conformes en fin
 +
      de fichier avec différents blocs (*... sans NL, {... sans NL en fin de
 +
      fichier
 +
.
 +
6:  Le caractère de fin de fichier (EOF) NE DOIT JAMAIS APPARAÎTRE DANS LE
 +
    TEXTE DU FICHIER CIBLE.
 +
    Ceci provoquait un bug dans la version Alpha de l'application fenêtrée
 +
    mkdcppw à l'étape du test d'intégration.
 +
    - La réponse est incluse dans les tests 5:
 +
    - Nous avons constaté que EOF est précédé du caractère OxOA (New Line)
 +
    - Tous les caractères sont recopiés octets par octets. La commande mkd
 +
      ignore le format du texte recopié. Il n'en est pas de même pour mkdcppw
 +
      qui ne reconnaît que les caractères UTF-8 nécessaires à l'impression.
 +
.
 +
7:  La commande ../../mkd -sP '**' trinoms2.pas permet aussi de contrôler les
 +
    commentaires imbrqués et la fin de fichier sur un commentaire non fermé.
 +
    - Les résultas sont conformes aux directives.
</pre>
</pre>
{{Boîte déroulante/fin}}
{{Boîte déroulante/fin}}
Ligne 375 : Ligne 504 :
{{Boîte déroulante/début|titre=trinoms*.pas}}
{{Boîte déroulante/début|titre=trinoms*.pas}}
-
<pre style color="black">
+
 
 +
* Fichier trinoms.pas
 +
<pre style = "color:black">
 +
 
 +
(*D
 +
(1 tab) test de tabulation pour mkd
 +
  **************************************************************************
 +
  *                                                                        *
 +
  * PROJET: Tri de noms                                                    *
 +
  *                                                                        *
 +
  * Titre :                  Trinoms          Préfixe global: ....      *
 +
  *                                                                        *
 +
  * Programme de tri de trois noms par ordre alphabétique.                *
 +
  * Mises à Jour du Module:                                                *
 +
  *    26/11/90 par JPL                                                    *
 +
  *                                                                        *
 +
  **************************************************************************
 +
  * PROGRAMMATION :                                                        *
 +
  *                                                                        *
 +
  * Dossier de conception : cours de Monsieur Jean BARRIER                *
 +
  * Environnement : DOS 3.3, Turbo Pascal 5                                *
 +
  * Sauvegarde : B:\PF\TRINOMS.PAS                                        *
 +
  *                                                                        *
 +
  **************************************************************************
 +
  *                                                                        *
 +
  * VERSION :  Date    Auteur  Commentaire                                *
 +
  * ---------------------------------------------------------------------- *
 +
  * 1.0      26/11/90  JPL    Version d'essai et d'évaluation de turbo 5  *
 +
  **************************************************************************
 +
  * STRUCTURE DU MODULE :                                                  *
 +
  *                                                                        *
 +
  *  1: Environnement :                                                    *
 +
  *    1.1 : Variables Publiques.                                        *
 +
  *    1.2 : Variables Globales Privées.                                  *
 +
  *                                                                        *
 +
  *  2: Programme principal: test du module                                *
 +
  *                                                                        *
 +
  **************************************************************************
 +
*)
 +
 +
{D
 +
  **************************************************************************
 +
  *                                                                        *
 +
  *    1.1 : Variables Publiques.                                        *
 +
  *                                                                        *
 +
  **************************************************************************
 +
}
 +
  USES Crt;        {D}
 +
 +
 +
 +
 +
{H
 +
  **************************************************************************
 +
  *                                                                        *
 +
  *    1.2 : Variables Globales Privées.                                  *
 +
  *                                                                        *
 +
  **************************************************************************
 +
}
 +
  VAR              {H}
 +
      Nom1 : STRING; {H}
 +
      Nom2 : STRING; {H}
 +
      Nom3 : STRING; {H}
 +
 +
(*O
 +
  **************************************************************************
 +
  * * 2: Programme principal: test du module                              *
 +
  * *      Fonction :                                                    *
 +
  * *          Lire 3 noms commençant par des lettres differentes frappées *
 +
  * *          au clavier, puis les afficherà l'écran, dans l'ordre        *
 +
  * *          alphabétique                                                *
 +
  * *      Entrez  : 3 noms au clavier.                                  *
 +
  * *      Sortie  : affichage à l'écran, dans l'ordre alphabétique      *
 +
  **************************************************************************
 +
}
 +
(*O Trinoms *)
 +
    BEGIN {S Trinoms }
 +
(*O    afficher "entrer un nom : " *)
 +
        Write( 'entrer un nom : ' );
 +
(*O    lire Nom1 *)
 +
        ReadLn( Nom1 );
 +
(*O    afficher "encore un    : " *)
 +
        Write( 'encore un    : ' );
 +
(*O    lire Nom2 *)
 +
        ReadLn( Nom2 );
 +
(*O    afficher "un dernier    : " *)
 +
        Write( 'un dernier    : ' );
 +
(*O    lire Nom3 *)
 +
        ReadLn( Nom3 );
 +
 +
(*O    SI Nom1 < Nom2 et Nom1 < Nom3 *)
 +
        IF ( Nom1 < Nom2 ) AND ( Nom1 < Nom3 )
 +
(*O    ALORS : (Nom1 est le premier) *)
 +
        THEN
 +
        BEGIN {S}
 +
(*O      afficher Nom1 *)
 +
          Write( Nom1, ' ' );
 +
 +
(*P * * Variante 1 du SI ALORS SINON à utiliser avec modération : *)
 +
 +
(*O      SI Nom2 < Nom3 ALORS afficher Nom2 puis Nom3 SINON afficher Nom3 puis Nom2 *)
 +
          IF ( Nom2 < Nom3 ) THEN Writeln( Nom2, ' ', Nom3 ) ELSE Writeln( Nom3, ' ', Nom2 );
 +
 +
        END {S}
 +
 +
(*O    SINON : (Nom1 n'est pas le premier....) *)
 +
        ELSE
 +
        BEGIN {S}
 +
(*O      SI Nom2 < Nom3 *)
 +
          IF ( Nom2 < Nom3 )
 +
(*O      ALORS : *)
 +
          THEN
 +
          BEGIN {S then Nom2 < Nom3 }
 +
(*O          afficher Nom2 *)
 +
              Write( Nom2, ' ' );
 +
 +
(*P * * Variante 2 du SI ALORS SINON à éviter : *)
 +
 
 +
</pre>
 +
 
 +
* Fichier trinoms2.pas
 +
<pre style = "color:blue">
 +
{T Fichier trinoms2.pas Test de la dernière ligne }
 +
{S Essayer la commande ../../mkd -sP '**' trinoms2.pas }
 +
(*O Fin Trinoms *)
 +
{T (*O Commentaire imbriqué *) }
 +
(*T {O Commentaire imbriqué } *)
 +
    END. {S Trinoms
 +
</pre>
 +
 
 +
* Fichier trinoms3.pas
 +
<pre style = "color:red">
 +
{Test de la dernière ligne}
 +
(*O Fin Trinoms *)
 +
    END. (*S Trinom
 +
</pre>
 +
 
 +
* Fichier trinoms4.pas
 +
<pre style = "color:green">
 +
{Test de la dernière ligne}
 +
(*O Fin Trinoms *)
 +
    END. (*S Trinoms}
</pre>
</pre>
{{Boîte déroulante/fin}}
{{Boîte déroulante/fin}}
[[Catégorie:Générateurs de documentation]]
[[Catégorie:Générateurs de documentation]]

Version actuelle en date du 11 mai 2013 à 13:52

Retour aux fichiers en développement →

Prise en compte des parenthèse curly { } et des parenthèses étoilées (* *).
Les commentaires peuvent être imbriqués mais pas accolés pour la même commande d'extraction.

Take into account the curly { } and starry (* *) brackets.
Comments can be nested but non-contiguous for the same extraction command.

Sommaire

Fichiers de la fonction pascal_()

Fichier de commande des tests

Analyse des tests konsole

Fichiers sources des tests

Outils personnels