Projet mkd/basic.c

De Wiki EELL.

(Différences entre les versions)
m (Mise à jour)
m (Fichier de commande des tests : Mise à jour)
 
(5 versions intermédiaires masquées)
Ligne 11 : Ligne 11 :
== Fichiers de la fonction basic_() ==
== Fichiers de la fonction basic_() ==
-
{{Boîte déroulante/début|Titre=___}}
+
{{Boîte déroulante/début|titre=basic.c, basic.cc, basic.inc.cc}}
-
*Fichier:
+
<pre Style="color:red">
<pre Style="color:red">
/*P
/*P
Ligne 336 : Ligne 335 :
== Fichier de commande des tests ==
== Fichier de commande des tests ==
-
{{Boîte déroulante/début|Titre=___}}
+
{{Boîte déroulante/début|titre=MAKE_Tests_U}}
-
*Fichier:
+
 
-
<pre Style="color:red">
+
<pre Style="color:black">
-
Blabla
+
#!/bin/bash
-
</pre>
+
#O File: MAKE_Tests_U
-
<pre>
+
#O ../../mkd tests under Linux.
 +
#O Epreuve de vérification de la fonction basic_() avec ../../mkd
 +
 
 +
#O    Copy Tests_exemple.bas in target created file
 +
      cat Tests_exemple.bas > Tests_exemple.tstbas
 +
 
 +
#O    Test options -nstv with source "Tests_exemple.bas" and target "*.tstbas"
 +
#O    - and screen redirection to tstbas.screen
 +
 
 +
#O 1: Test de l'option -s append target
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "1: Test de l'option -s append target" >> Tests_exemple.tstbas
 +
      ../../mkd -savB T Tests_exemple.bas *.tstbas > tstbas.screen
 +
 
 +
#O 1: Test option -t
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "1: Test option -t" >> Tests_exemple.tstbas
 +
      ../../mkd -tavB T Tests_exemple.bas *.tstbas # >> tstbas.screen
 +
 
 +
#O 1: Test option -n, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "1: Test option -n, with append files target and screen" >> Tests_exemple.tstbas
 +
      ../../mkd -navB T Tests_exemple.bas *.tstbas # >> tstbas.screen
 +
 
 +
#O 2: Test options -ns, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "2: Test options -ns, with append files target and screen" >> Tests_exemple.tstbas
 +
      ../../mkd -nsavB T Tests_exemple.bas *.tstbas >> tstbas.screen
 +
 
 +
#O 2: Test options -nt, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "2: Test options -nt, with append files target and screen" >> Tests_exemple.tstbas
 +
      ../../mkd -ntavB T Tests_exemple.bas *.tstbas >> tstbas.screen
 +
 
 +
#O 2: Test options -nst, with append files target and screen
 +
      echo "------------------------------------------------------------------" >> Tests_exemple.tstbas
 +
      echo "2: Test options -nst, with append files target and screen" >> Tests_exemple.tstbas
 +
      ../../mkd -nstavB T Tests_exemple.bas *.tstbas >> tstbas.screen
 +
 
 +
#O 5: Independant test with -nstv "Tests_exemple.bas" and target "*.tstbaslastline1"
 +
      ../../mkd -nstvwB '**' Tests_exemple.bas *.tstbaslastline1 > tstbaslastline.screen1
 +
 
 +
#O 5: Independant test with -nstv "Tests_exemple.bas" and target "*.tstbaslastline1"
 +
      ../../mkd -nsvaB '**' Tests_exemple.bas *.tstbaslastline1 >> tstbaslastline.screen1
 +
 
 +
 
 +
 
 +
#O    Break with gedit "Tests_exemple.tstbas", "tstbas.screen"
 +
      gedit Tests_exemple.tstbas tstbas.screen Tests_exemple.tstbaslastline1 tstbaslastline.screen1
 +
 
 +
#w bug      gedit Tests_exemple.bas.tstbaslastline2 #bug in version < 2012
 +
 
 +
#O    Erase Tests_exemple.tstbas
</pre>
</pre>
{{Boîte déroulante/fin}}
{{Boîte déroulante/fin}}
== Analyse des tests konsole ==
== Analyse des tests konsole ==
-
{{Boîte déroulante/début|Titre=___}}
+
{{Boîte déroulante/début|titre=Analysis 2013-05-05}}
-
*Fichier:
+
<pre Style="color:blue">
<pre Style="color:blue">
Fichier Analysis texte UTF-8
Fichier Analysis texte UTF-8
Ligne 408 : Ligne 460 :
== Fichier source des tests ==
== Fichier source des tests ==
-
{{Boîte déroulante/début|Titre=___}}
+
{{Boîte déroulante/début|titre="exemple2.bas, Make_TU_cpp.bat"}}
-
*Fichier:  
+
* Fichier: exemple2.bas
<pre Style="color:red">
<pre Style="color:red">
-
Blabla
+
' ISO-8859-1
 +
REMT  Fichier exemple2.bas copié de
 +
REM T http://fr.wikipedia.org/wiki/BASIC
 +
REM T pour les tests unitaires de la fonction basic_()
 +
' ----------------------------------------------------
 +
RemT Tester avec Codes = 'T' et '<'
 +
'T 1 tabulation
 +
INPUT "Quel est votre nom"; UserName$ 'T
 +
PRINT "Bonjour "; UserName$ 'T
 +
DO
 +
  INPUT "Combien d'étoiles voulez-vous"; NumStars
 +
  Stars$ = ""
 +
  Stars$ = REPEAT$("*", NumStars) ' <-ANSI BASIC
 +
  'Stars$ = STRING$(NumStars, "*") ' <-MS BASIC
 +
  PRINT Stars$
 +
  DO
 +
    INPUT "Voulez-vous plus d'étoiles"; Answer$
 +
  LOOP UNTIL Answer$ <> ""
 +
LOOP WHILE UCASE$(LEFT$(Answer$, 1)) = "O"
 +
PRINT "Au revoir ";
 +
FOR A = 1 TO 200
 +
  PRINT UserName$; " "; 'T
 +
NEXT A
 +
PRINT
 +
 
 +
REM  Tester avec Codes = '**'
 +
1 10 REM - APPLESOFT - BASIC
 +
2 20 REM -> TEST
 +
3 30 IF I > 10 THEN GOSUB 60
 +
4 40 I= I + 1:GOTO 30
 +
5 50 REM -> ALERT
 +
6 60 PRINT I;" I IS GREATER THAN 10"
 +
7 70 RETURN
 +
8 80 END
 +
 
 +
'S Lastline without NL
</pre>
</pre>
-
<pre>
+
 
 +
* Fichier Make_TU_cpp.bat (Command for terminal MS-Windows)
 +
<pre Style="color:blue">
 +
REMO Command file Make_TU_cpp_.bat
 +
REMO ( mkd tests under Windows. )
 +
REMO Épreuve de vérification de la fonction cpp_() avec mkd
 +
REMO Modifié par Polo le 8 avril 2013
 +
REMO
 +
 
 +
echo Begin REMO
 +
echo ============== Reference text: ============== > Test_cpp_U.tstcpp.txt
 +
echo Tests 1: options -nstv with source Test_cpp_U.cc and target Test_cpp_U.tstcpp.txt >> Test_cpp_U.tstcpp.txt
 +
echo - and screen redirection to tstcpp.screen.txt >> Test_cpp_U.tstcpp.txt
 +
      type Test_cpp_U.cc >> Test_cpp_U.tstcpp.txt
 +
 
 +
echo. >> Test_cpp_U.tstcpp.txt > tstcpp.screen.txt
 +
 +
echo ============== Test 1 -s ============== >> Test_cpp_U.tstcpp.txt
 +
echo ============== Test 1 -s ============== >> tstcpp.screen.txt
 +
echo 1: Test option -s append target >> Test_cpp_U.tstcpp.txt
 +
 
 +
      mkd -savC T Test_cpp_U.cc Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo. >> Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo ============== Test 1 -t ============== >> Test_cpp_U.tstcpp.txt
 +
echo ============== Test 1 -t ============== >> tstcpp.screen.txt
 +
echo 1: Test option -t append target >> Test_cpp_U.tstcpp.txt
 +
 
 +
      mkd -tavC T Test_cpp_U.cc Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo. >> Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo ============== Test 1 -n ============== >> Test_cpp_U.tstcpp.txt
 +
echo ============== Test 1 -n ============== >> tstcpp.screen.txt
 +
echo 1: Test option -n, with append files target without screen >> Test_cpp_U.tstcpp.txt
 +
 
 +
      mkd -navC T Test_cpp_U.cc Test_cpp_U.tstcpp.txt  >> tstcpp.screen.txt
 +
 
 +
echo. >> Test_cpp_U.tstcpp.txt>> tstcpp.screen.txt
 +
 
 +
echo ============== Test 2 -ns ============== >> Test_cpp_U.tstcpp.txt
 +
echo ============== Test 2 -ns ============== >> tstcpp.screen.txt
 +
echo 2: Test options -ns, with append files target and screen >> Test_cpp_U.tstcpp.txt
 +
 
 +
      mkd -nsavC T Test_cpp_U.cc Test_cpp_U.tstcpp.txt  >> tstcpp.screen.txt
 +
 
 +
echo. >> Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo ============== Test 2 -nt ============== >> Test_cpp_U.tstcpp.txt
 +
echo ============== Test 2 -nt ============== >> tstcpp.screen.txt
 +
echo 2: Test options -nt, with append files target and screen >> Test_cpp_U.tstcpp.txt
 +
      mkd -ntavC T Test_cpp_U.cc Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo. >> Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo ============== Test 2 -nst ============== >> Test_cpp_U.tstcpp.txt
 +
echo ============== Test 2 -nst ============== >> tstcpp.screen.txt
 +
echo 2: Test options -nst, with append files target and screen >> Test_cpp_U.tstcpp.txt
 +
 
 +
      mkd -nstavC T Test_cpp_U.cc Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo. >> Test_cpp_U.tstcpp.txt >> tstcpp.screen.txt
 +
 
 +
echo ============== Test 5 last line without NL ============== > tstcpplastline.screen1.txt
 +
REM 5.0: Independant test with -nstv "Test_cpp_U.cc" and target "Test_cpp_U.tstcpplastline1.txt"
 +
      mkd -nstvwC T Test_cpp_U.cc Test_cpp_U.tstcpplastline1.txt >> tstcpplastline.screen1.txt
 +
REM 5.0 Avec VC10 la redirection imprime les numéros de lignes ne retrouvent
 +
REM    pas dans le fichier cible.
 +
REM 5.1 Même commande qu'en 5.1 sans redirection.
 +
      mkd -nstvwC T Test_cpp_U.cc Test_cpp_U.tstcpplastline1.1.txt
 +
REM 5.1 Les numéros de ligne se trouvent à la bonne place ainsi que les
 +
REM    commentaires  
 +
echo. >> Test_cpp_U.tstcpp.txt
 +
 
 +
echo ============== Test 5 last bloc without NL ============== > tstcpplastline.screen2.txt
 +
REM 5: Independant test with -nstv "Test_cpp_U.c" and target file "Test_cpp_U.cc.tstcpplastline2"
 +
REM bug      mkd -nstvwC T Test_cpp_U.c Test_cpp_U.tstcpplastline2.txt >> tstcpplastline.screen2.txt
 +
 
 +
echo *************** END *********************************************************** >> Test_cpp_U.tstcpp.txt
 +
 
 +
REMO Break with gedit for Windows "Test_cpp_U.tstcpp.txt", "tstcpp.screen.txt"
 +
      "C:\Program Files (x86)\gedit\bin\gedit.exe" Test_cpp_U.tstcpp.txt tstcpp.screen.txt Test_cpp_U.tstcpplastline1.txt
 +
      rem "C:\Program Files (x86)\gedit\bin\gedit.exe" tstcpp.screen.txt
 +
      rem "C:\Program Files (x86)\gedit\bin\gedit.exe" Test_cpp_U.tstcpplastline1.txt
 +
  rem "C:\Program Files (x86)\Notepad++\notepad++.exe" Test_cpp_U.tstcpp.txt
 +
      rem notepad++ tstcpp.screen.txt
 +
      rem notepad++ Test_cpp_U.tstcpplastline1.txt
 +
REMw bug      "C:\Program Files (x86)\gedit\bin\gedit.exe" Test_cpp_U.cc.tstcpplastline2.txt
 +
Pause CTRL-C to quit, or NL to erase the files
 +
Clean_tests
</pre>
</pre>
{{Boîte déroulante/fin}}
{{Boîte déroulante/fin}}
 +
 +
[[Catégorie:Générateurs de documentation]]

Version actuelle en date du 5 mai 2013 à 16:56

Retour aux fichiers en développement →

REMARQUES : Il est important de laisser un espace entre le caractère de début
    de commentaire ' ou REM et le commentaire proprement dit, afin d'éviter
    les caractères ignorés. 
    Il est à noter également que l'apostrophe peut être pris pour un caractère
    de début de commentaire lorsque les commentaires ne sont pas 'Codés'
    (Option t et Codes '**')

Sommaire

Fichiers de la fonction basic_()

Fichier de commande des tests

Analyse des tests konsole

Fichier source des tests

Outils personnels