Skip to content

Commit bf3f319

Browse files
DONE Added documentation for argos_cli
1 parent cc015d4 commit bf3f319

1 file changed

Lines changed: 161 additions & 0 deletions

File tree

content/docs/cours/ARGOS.md

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,164 @@ Pour mettre à jour votre repository local, il faut :
8787
{{< attention >}}
8888
Il ne faut modifier aucun autre fichier dans le répertoire **`UnitTests`**.
8989
{{< /attention >}}
90+
91+
## Outils CLI pour ARGOS
92+
Un outil en ligne de commande (CLI) est disponible pour faciliter certaines opérations sur ARGOS.
93+
Il est livré avec ARGOS.
94+
95+
{{< a_noter>}}
96+
Il faut mettre à jour son repository local pour bénéficier de cet outil.
97+
Pour cela, suivre la procédure décrite dans la section **Mettre à jour la liste des exercices**.
98+
{{</a_noter>}}
99+
100+
### Installation
101+
**`argos_cli`** nécessite CMake et Ninja pour fonctionner.
102+
1. Installer CMake : **[https://cmake.org/download/](https://cmake.org/download/)**.
103+
2. Installer Ninja : **[https://ninja-build.org/](https://ninja-build.org/)**.
104+
105+
### Utilisation
106+
**`argos_cli`** est disponible dans le répertoire racine du projet ARGOS.
107+
108+
#### Initialiser un projet ARGOS
109+
Pour initialiser un projet ARGOS, exécuter la commande suivante depuis le répertoire racine de votre projet ARGOS :
110+
```
111+
.\argos_cli.exe init
112+
```
113+
Si tout se passe bien, un message de confirmation s'affiche :
114+
```
115+
Initializing ARGOS...Done.
116+
```
117+
118+
#### Compiler les exercices
119+
Pour compiler les exercices, exécuter la commande suivante depuis le répertoire racine de votre projet ARGOS :
120+
```
121+
.\argos_cli.exe build
122+
```
123+
Si tout se passe bien, un message de confirmation s'affiche :
124+
```
125+
Building ARGOS...Done.
126+
```
127+
128+
Il est aussi possible de recompiler tous les exercices en utilisant la commande :
129+
```
130+
.\argos_cli.exe rebuild
131+
```
132+
133+
#### Lancer les tests des exercices
134+
Pour lancer les tests des exercices, exécuter la commande suivante depuis le répertoire racine de votre projet ARGOS :
135+
```
136+
.\argos_cli.exe test
137+
```
138+
Vous obtenez un rapport de test similaire à celui-ci :
139+
```
140+
.\argos_cli.exe test
141+
Testing ARGOS...Done.
142+
🔴 ch01.ch01_ex01_printHelloWorld
143+
🟢 ch01.ch01_ex02_printMathCalc
144+
🟢 ch01.ch01_ex03_SomeCalculus
145+
🟢 ch02.ch02_ex11_Swap
146+
🟢 ch02.ch02_ex21_CelsiusToFarenheit
147+
🟢 ch02.ch02_ex22_AssetInterestRate
148+
🟢 ch04.ch04_ex01_Printf
149+
🟢 ch04.ch04_ex02_ScanfPrintf
150+
🟢 ch04.ch04_ex03_Circle
151+
🟢 ch05.ch05_ex02_LowercaseUppercase
152+
🟢 ch05.ch05_ex03_MultiplicationSign
153+
🟢 ch05.ch05_ex04_DecreasingOutput
154+
🟢 ch05.ch05_ex07_SecondOrderEquation
155+
🟢 ch05.ch05_ex22_CurrencyConverter
156+
🟢 ch05.ch05_ex23_DaysInMonth
157+
🟢 ch05.ch05_ex32_SumProductMean
158+
🟢 ch05.ch05_ex33_Factorial
159+
🟢 ch06.ch06_ex04_Squares
160+
🟢 ch06.ch06_ex06_Calculator
161+
🟢 ch06.ch06_ex07_SumN
162+
🟢 ch06.ch06_ex08_Invert
163+
🟢 ch08.ch08_ex21_1_CompareArray
164+
🟢 ch08.ch08_ex21_2_PrintArray
165+
🟢 ch08.ch08_ex21_3_FillArray
166+
🟢 ch08.ch08_ex21_ArraySum
167+
🟢 ch08.ch08_ex23_Array2DSum
168+
🟢 ch08.ch08_ex24_DotProduct
169+
🟢 ch08.ch08_ex41_Time
170+
🟢 ch08.ch08_ex42_ComplexSum
171+
🟢 ch08.ch08_ex42_ComplexDiff
172+
🟢 ch08.ch08_ex43_Person
173+
🟢 ch09.ch09_ex06_CopyArrays
174+
🟢 ch09.ch09_ex10_Swap
175+
🟢 ch11.ch11_ex02_Reset
176+
🟢 ch11.ch11_ex03_ResetPointer
177+
🟢 ch11.ch11_ex07_EditArray
178+
```
179+
180+
Il est aussi possible de ne tester qu'un ou plusieurs chapitres en particulier en utilisant l'option `--chapters` ou `-c` suivie des numéros des chapitres à tester :
181+
```
182+
.\argos_cli.exe test -c ch01 ch02
183+
```
184+
Vous obtenez un rapport de test similaire à celui-ci :
185+
```
186+
.\argos_cli.exe test -c ch01 ch02
187+
Testing ARGOS...Done.
188+
🔴 ch01.ch01_ex01_printHelloWorld
189+
🟢 ch01.ch01_ex02_printMathCalc
190+
🟢 ch01.ch01_ex03_SomeCalculus
191+
🟢 ch02.ch02_ex11_Swap
192+
🟢 ch02.ch02_ex21_CelsiusToFarenheit
193+
🟢 ch02.ch02_ex22_AssetInterestRate
194+
```
195+
196+
Pour identifier les erreurs dans les tests, vous pouvez utiliser l'option `--verbose` ou `-v` :
197+
```
198+
.\argos_cli.exe test -c ch01 --verbose
199+
```
200+
Ce qui donnera un rapport de test plus détaillé :
201+
```
202+
.\argos_cli.exe test -c ch01 --verbose
203+
Testing ARGOS...
204+
205+
Test project D:/HE-Arc_WorkingFilesSYNC/COURS/ARGOS/benoit-le-callennec/BUILD
206+
Start 1: ch01.ch01_ex01_printHelloWorld
207+
1/3 Test #1: ch01.ch01_ex01_printHelloWorld ...***Failed 0.02 sec
208+
Running main() from D:/HE-Arc_WorkingFilesSYNC/COURS/ARGOS/benoit-le-callennec/BUILD/_deps/googletest-src/googletest/src/gtest_main.cc
209+
Note: Google Test filter = ch01.ch01_ex01_printHelloWorld
210+
[==========] Running 1 test from 1 test suite.
211+
[----------] Global test environment set-up.
212+
[----------] 1 test from ch01
213+
[ RUN ] ch01.ch01_ex01_printHelloWorld
214+
D:/HE-Arc_WorkingFilesSYNC/COURS/ARGOS/benoit-le-callennec/UnitTests/ch01/ch01_TEST.cpp:25: Failure
215+
Expected equality of these values:
216+
expected
217+
Which is: "hello, world\n"
218+
actual
219+
Which is: "hello, fdsaworld\n"
220+
221+
CHECK ch01_ex01_PrintHelloWorld() output!
222+
223+
[ FAILED ] ch01.ch01_ex01_printHelloWorld (10 ms)
224+
[----------] 1 test from ch01 (10 ms total)
225+
226+
[----------] Global test environment tear-down
227+
[==========] 1 test from 1 test suite ran. (11 ms total)
228+
[ PASSED ] 0 tests.
229+
[ FAILED ] 1 test, listed below:
230+
[ FAILED ] ch01.ch01_ex01_printHelloWorld
231+
232+
1 FAILED TEST
233+
234+
Start 2: ch01.ch01_ex02_printMathCalc
235+
2/3 Test #2: ch01.ch01_ex02_printMathCalc ..... Passed 0.02 sec
236+
Start 3: ch01.ch01_ex03_SomeCalculus
237+
3/3 Test #3: ch01.ch01_ex03_SomeCalculus ...... Passed 0.01 sec
238+
239+
67% tests passed, 1 tests failed out of 3
240+
241+
Total Test time (real) = 0.10 sec
242+
243+
The following tests FAILED:
244+
1 - ch01.ch01_ex01_printHelloWorld (Failed)
245+
Errors while running CTest
246+
Done.
247+
🔴 ch01.ch01_ex01_printHelloWorld
248+
🟢 ch01.ch01_ex02_printMathCalc
249+
🟢 ch01.ch01_ex03_SomeCalculus
250+
```

0 commit comments

Comments
 (0)