Commit e5411e55a17378a9364716e38fa6b878198861b6

Authored by Benjamin Renard
1 parent cb14018f

Add tests in Fitnesse for parser

test/FitNesseRoot/ReleaseS/TmaAmda/ReLease4/ExpressionParser/content.txt 0 → 100644
... ... @@ -0,0 +1,34 @@
  1 +!1 #5639 : Proper expression parser
  2 +
  3 +!define path {../test/FitNesseRoot/ReleaseS/TmaAmda/ReLease4/ExpressionParser/}
  4 +!define executable {expressionParser }
  5 +
  6 +!2 Description de l'évolution
  7 +
  8 +Mettre en place un parser d'expression de la syntaxe IHM vers la syntaxe Kernel
  9 +
  10 +!2 Description de la correction
  11 +
  12 +Implémentation de l'exécutable "expressionParser" basé sur l'utilisation de "boost spirit"
  13 +
  14 +!2 Test
  15 +
  16 +!3 Connexion au serveur
  17 +
  18 +!|script|ConnectToDDServer|
  19 +|check|login|1|
  20 +
  21 +!|script|TestAmdaCommandLine|
  22 +|set|${path}|path|
  23 +
  24 +!3 Exécution des scripts
  25 +
  26 +!|script|TestAmdaCommandLine|
  27 +|note|!- Execution d'un jeu de test pour le parseur -!|
  28 +|check|execute|${executable}|command|-t ${path}test_parser.csv -o result_parser.xml|args|0|
  29 +|check|execute|xmllint|command|-format result_parser.xml -o result_parser_pretty.xml|args|0|
  30 +|check|execute|diff|command|result_parser_pretty.xml ${path}/result_parser_pretty_REF.xml|args|0|
  31 +
  32 +
  33 +-----
  34 +!contents -R2 -g -p -f -h
... ...
test/FitNesseRoot/ReleaseS/TmaAmda/ReLease4/ExpressionParser/properties.xml 0 → 100644
... ... @@ -0,0 +1,10 @@
  1 +<?xml version="1.0"?>
  2 +<properties>
  3 + <Edit/>
  4 + <Files/>
  5 + <Properties/>
  6 + <Refactor/>
  7 + <Search/>
  8 + <Test/>
  9 + <WhereUsed/>
  10 +</properties>
... ...
test/FitNesseRoot/ReleaseS/TmaAmda/ReLease4/ExpressionParser/result_parser_pretty_REF.xml 0 → 100644
... ... @@ -0,0 +1,267 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<expressions>
  3 + <expression success="true">
  4 + <ihm>1</ihm>
  5 + <kernel>1</kernel>
  6 + <params/>
  7 + </expression>
  8 + <expression success="true">
  9 + <ihm>-1</ihm>
  10 + <kernel>-1</kernel>
  11 + <params/>
  12 + </expression>
  13 + <expression success="true">
  14 + <ihm>1*2</ihm>
  15 + <kernel>(1*2)</kernel>
  16 + <params/>
  17 + </expression>
  18 + <expression success="true">
  19 + <ihm>-1*2</ihm>
  20 + <kernel>(-1*2)</kernel>
  21 + <params/>
  22 + </expression>
  23 + <expression success="true">
  24 + <ihm>2*-1</ihm>
  25 + <kernel>(2*-1)</kernel>
  26 + <params/>
  27 + </expression>
  28 + <expression success="true">
  29 + <ihm>-1+2</ihm>
  30 + <kernel>(-1+2)</kernel>
  31 + <params/>
  32 + </expression>
  33 + <expression success="true">
  34 + <ihm>1+2</ihm>
  35 + <kernel>(1+2)</kernel>
  36 + <params/>
  37 + </expression>
  38 + <expression success="true">
  39 + <ihm>1-2</ihm>
  40 + <kernel>(1-2)</kernel>
  41 + <params/>
  42 + </expression>
  43 + <expression success="true">
  44 + <ihm>-(1+2)</ihm>
  45 + <kernel>-(1+2)</kernel>
  46 + <params/>
  47 + </expression>
  48 + <expression success="true">
  49 + <ihm>-(-1-2)</ihm>
  50 + <kernel>-(-1-2)</kernel>
  51 + <params/>
  52 + </expression>
  53 + <expression success="true">
  54 + <ihm>-1*-5/-10+30-55/(-37*(2+-1))</ihm>
  55 + <kernel>((-1*(-5/-10))+(30-(55/(-37*(2+-1)))))</kernel>
  56 + <params/>
  57 + </expression>
  58 + <expression success="true">
  59 + <ihm>2/-1</ihm>
  60 + <kernel>(2/-1)</kernel>
  61 + <params/>
  62 + </expression>
  63 + <expression success="true">
  64 + <ihm>-2/+1</ihm>
  65 + <kernel>(-2/+1)</kernel>
  66 + <params/>
  67 + </expression>
  68 + <expression success="true">
  69 + <ihm>-2*3+1/5-3+2-57/-23*-87</ihm>
  70 + <kernel>(((-2*3)+((1/5)-3))+(2-((57/-23)*-87)))</kernel>
  71 + <params/>
  72 + </expression>
  73 + <expression success="true">
  74 + <ihm>@Re</ihm>
  75 + <kernel>6.3712e+06</kernel>
  76 + <params/>
  77 + </expression>
  78 + <expression success="true">
  79 + <ihm>-@Re</ihm>
  80 + <kernel>-6.3712e+06</kernel>
  81 + <params/>
  82 + </expression>
  83 + <expression success="true">
  84 + <ihm>37*-@Re</ihm>
  85 + <kernel>(37*-6.3712e+06)</kernel>
  86 + <params/>
  87 + </expression>
  88 + <expression success="true">
  89 + <ihm>6.3712e+06</ihm>
  90 + <kernel>(6.3712e+06)</kernel>
  91 + <params/>
  92 + </expression>
  93 + <expression success="true">
  94 + <ihm>6.3712e6</ihm>
  95 + <kernel>(6.3712e6)</kernel>
  96 + <params/>
  97 + </expression>
  98 + <expression success="true">
  99 + <ihm>-6.3712e-6</ihm>
  100 + <kernel>(-6.3712e-6)</kernel>
  101 + <params/>
  102 + </expression>
  103 + <expression success="true">
  104 + <ihm>6.3712e(-9+3)</ihm>
  105 + <kernel>(6.3712e(-9+3))</kernel>
  106 + <params/>
  107 + </expression>
  108 + <expression success="true">
  109 + <ihm>6.3712e-9+3</ihm>
  110 + <kernel>((6.3712e-9)+3)</kernel>
  111 + <params/>
  112 + </expression>
  113 + <expression success="true">
  114 + <ihm>6.3712e-9*3</ihm>
  115 + <kernel>((6.3712e-9)*3)</kernel>
  116 + <params/>
  117 + </expression>
  118 + <expression success="true">
  119 + <ihm>3*2&gt;5-1</ihm>
  120 + <kernel>((3*2)&gt;(5-1))</kernel>
  121 + <params/>
  122 + </expression>
  123 + <expression success="true">
  124 + <ihm>3=2&gt;=1</ihm>
  125 + <kernel>(3==(2&gt;=1))</kernel>
  126 + <params/>
  127 + </expression>
  128 + <expression success="true">
  129 + <ihm>imf</ihm>
  130 + <kernel>$imf</kernel>
  131 + <params>
  132 + <param>imf</param>
  133 + </params>
  134 + </expression>
  135 + <expression success="true">
  136 + <ihm>sqrt(imf(0)*imf(0)+imf(1)*imf(1)+imf(2)*imf(2))</ihm>
  137 + <kernel>sqrt(((($imf[0]*$imf[0])+($imf[1]*$imf[1]))+($imf[2]*$imf[2])))</kernel>
  138 + <params>
  139 + <param>imf</param>
  140 + </params>
  141 + </expression>
  142 + <expression success="true">
  143 + <ihm>2^3</ihm>
  144 + <kernel>pow(2,3)</kernel>
  145 + <params/>
  146 + </expression>
  147 + <expression success="true">
  148 + <ihm>c1_hia_pad(2,5)</ihm>
  149 + <kernel>$c1_hia_pad[2][5]</kernel>
  150 + <params>
  151 + <param>c1_hia_pad</param>
  152 + </params>
  153 + </expression>
  154 + <expression success="true">
  155 + <ihm>c1_hia_pad(2,*)</ihm>
  156 + <kernel>$c1_hia_pad[2]</kernel>
  157 + <params>
  158 + <param>c1_hia_pad</param>
  159 + </params>
  160 + </expression>
  161 + <expression success="true">
  162 + <ihm>c1_hia_pad(2)</ihm>
  163 + <kernel>$c1_hia_pad[2]</kernel>
  164 + <params>
  165 + <param>c1_hia_pad</param>
  166 + </params>
  167 + </expression>
  168 + <expression success="true">
  169 + <ihm>c1_hia_pad(*,5)</ihm>
  170 + <kernel>($c1_hia_pad).getColumn(5)</kernel>
  171 + <params>
  172 + <param>c1_hia_pad</param>
  173 + </params>
  174 + </expression>
  175 + <expression success="true">
  176 + <ihm>c1_hia_pad</ihm>
  177 + <kernel>$c1_hia_pad</kernel>
  178 + <params>
  179 + <param>c1_hia_pad</param>
  180 + </params>
  181 + </expression>
  182 + <expression success="true">
  183 + <ihm>c1_hia_pad(*,*)</ihm>
  184 + <kernel>$c1_hia_pad</kernel>
  185 + <params>
  186 + <param>c1_hia_pad</param>
  187 + </params>
  188 + </expression>
  189 + <expression success="true">
  190 + <ihm>c1_hia_pad(indexes[3,15],*)</ihm>
  191 + <kernel>#sum_into_table_indexes($c1_hia_pad;0;3;15)</kernel>
  192 + <params>
  193 + <param>c1_hia_pad</param>
  194 + </params>
  195 + </expression>
  196 + <expression success="true">
  197 + <ihm>c1_hia_pad(range[1.2,30.5],*)</ihm>
  198 + <kernel>#sum_into_table_range($c1_hia_pad;0;1.2;30.5)</kernel>
  199 + <params>
  200 + <param>c1_hia_pad</param>
  201 + </params>
  202 + </expression>
  203 + <expression success="true">
  204 + <ihm>c1_hia_pad(indexes[3,15],5)</ihm>
  205 + <kernel>#sum_into_table_indexes(($c1_hia_pad).getColumn(5);0;3;15)</kernel>
  206 + <params>
  207 + <param>c1_hia_pad</param>
  208 + </params>
  209 + </expression>
  210 + <expression success="true">
  211 + <ihm>c1_hia_pad(range[1.2,30.5],5)</ihm>
  212 + <kernel>#sum_into_table_range(($c1_hia_pad).getColumn(5);0;1.2;30.5)</kernel>
  213 + <params>
  214 + <param>c1_hia_pad</param>
  215 + </params>
  216 + </expression>
  217 + <expression success="true">
  218 + <ihm>c1_hia_pad(indexes[3,15],indexes[5,10])</ihm>
  219 + <kernel>#sum_into_table_indexes($c1_hia_pad;0;3;15;5;10)</kernel>
  220 + <params>
  221 + <param>c1_hia_pad</param>
  222 + </params>
  223 + </expression>
  224 + <expression success="true">
  225 + <ihm>c1_hia_pad(range[1.2,30.5],range[15.3,27.])</ihm>
  226 + <kernel>#sum_into_table_range($c1_hia_pad;0;1.2;30.5;15.3;27)</kernel>
  227 + <params>
  228 + <param>c1_hia_pad</param>
  229 + </params>
  230 + </expression>
  231 + <expression success="true">
  232 + <ihm>c1_hia_pad(*,indexes[5,10])</ihm>
  233 + <kernel>#sum_into_table_indexes($c1_hia_pad;1;5;10)</kernel>
  234 + <params>
  235 + <param>c1_hia_pad</param>
  236 + </params>
  237 + </expression>
  238 + <expression success="true">
  239 + <ihm>c1_hia_pad(*,range[15.3,27.])</ihm>
  240 + <kernel>#sum_into_table_range($c1_hia_pad;1;15.3;27)</kernel>
  241 + <params>
  242 + <param>c1_hia_pad</param>
  243 + </params>
  244 + </expression>
  245 + <expression success="true">
  246 + <ihm>c1_hia_pad(4,indexes[5,10])</ihm>
  247 + <kernel>#sum_into_table_indexes($c1_hia_pad[4];1;5;10)</kernel>
  248 + <params>
  249 + <param>c1_hia_pad</param>
  250 + </params>
  251 + </expression>
  252 + <expression success="true">
  253 + <ihm>c1_hia_pad(4,range[15.3,27.])</ihm>
  254 + <kernel>#sum_into_table_range($c1_hia_pad[4];1;15.3;27)</kernel>
  255 + <params>
  256 + <param>c1_hia_pad</param>
  257 + </params>
  258 + </expression>
  259 + <expression success="true">
  260 + <ihm>ws_test(0)*wsd_test</ihm>
  261 + <kernel>($ws_test[0]*$wsd_test)</kernel>
  262 + <params>
  263 + <param>ws_test</param>
  264 + <param>wsd_test</param>
  265 + </params>
  266 + </expression>
  267 +</expressions>
... ...
test/parser/amda_test_parser.csv renamed to test/FitNesseRoot/ReleaseS/TmaAmda/ReLease4/ExpressionParser/test_parser.csv
... ... @@ -43,5 +43,6 @@ c1_hia_pad(indexes[3,15],indexes[5,10]);&quot;#sum_into_table_indexes($c1_hia_pad;0;3
43 43 c1_hia_pad(range[1.2,30.5],range[15.3,27.]);"#sum_into_table_range($c1_hia_pad;0;1.2;30.5;15.3;27)"
44 44 c1_hia_pad(*,indexes[5,10]);"#sum_into_table_indexes($c1_hia_pad;1;5;10)"
45 45 c1_hia_pad(*,range[15.3,27.]);"#sum_into_table_range($c1_hia_pad;1;15.3;27)"
46   -c1_hia_pad(4,indexes[5,10]);"#sum_into_table_indexes($c1_hia_pad[4];0;5;10)"
47   -c1_hia_pad(4,range[15.3,27.]);"#sum_into_table_range($c1_hia_pad[4];0;15.3;27)"
  46 +c1_hia_pad(4,indexes[5,10]);"#sum_into_table_indexes($c1_hia_pad[4];1;5;10)"
  47 +c1_hia_pad(4,range[15.3,27.]);"#sum_into_table_range($c1_hia_pad[4];1;15.3;27)"
  48 +ws_test(0)*wsd_test;"($ws_test[0]*$wsd_test)"
... ...
test/FitNesseRoot/ReleaseS/TmaAmda/ReLease4/content.txt 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +!1 Release 4
  2 +!2 Listes des anomalies corrigées lors de la Release 4
  3 +
  4 +!2 Listes des évolutions traitées lors de la Release 4
  5 +* [[#5639: Proper expression parser][>ExpressionParser]]
  6 +-----
  7 +!contents -R2 -g -p -f -h
... ...
test/FitNesseRoot/ReleaseS/TmaAmda/ReLease4/properties.xml 0 → 100644
... ... @@ -0,0 +1,11 @@
  1 +<?xml version="1.0"?>
  2 +<properties>
  3 + <Edit/>
  4 + <Files/>
  5 + <Help/>
  6 + <Properties/>
  7 + <Refactor/>
  8 + <Search/>
  9 + <Suite/>
  10 + <WhereUsed/>
  11 +</properties>
... ...
test/FitNesseRoot/ReleaseS/TmaAmda/content.txt
... ... @@ -3,6 +3,7 @@
3 3 * [[Release 1][>ReLease1]]
4 4 * [[Release 2][>ReLease2]]
5 5 * [[Release 3][>ReLease3]]
  6 + * [[Release 4][>ReLease4]]
6 7  
7 8 ------
8 9 !contents -R2 -g -p -f -h
... ...