diff --git a/README.md b/README.md index e69de29..1527180 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,47 @@ +# testium training slides + +Beamer presentation (LuaLaTeX) for the testium training. + +## Compilation + +Requires LuaLaTeX with the `minted` package (which requires Python and `pygments`). + +```sh +make +``` + +The output PDF is generated in `build/`. + +To clean the build directory: + +```sh +make clean +``` + +## Document architecture + +``` +src/ +├── main.tex # Entry point — includes all sections +├── preamble.tex # Packages, theme, colors, macros +├── images/ +│ └── logo.png +└── sections/ + ├── title.tex # Title page + ├── summary.tex # Table of contents + ├── intro.tex # Introduction: features, input files, CLI, variables, inline eval, links + ├── installation.tex # Installation from binary or sources + ├── items.tex # Test items reference (console, py_func, loop, check, etc.) + ├── functionalities.tex # Advanced features: result processing, includes, templating, reports + ├── tips.tex # Tips and tricks + └── conclusion.tex # Thank you + contact +``` + +### Macros + +| Macro | Usage | +|---|---| +| `\incode{text}` | Inline code (bold blue monospace) | +| `\tum{text}` | testium name highlight (bold orange italic) | +| `\pass{text}` | PASS result (bold green monospace) | +| `\fail{text}` | FAIL result (bold red monospace) | diff --git a/src/sections/functionalities.tex b/src/sections/functionalities.tex index d0a0a38..9bfb80f 100644 --- a/src/sections/functionalities.tex +++ b/src/sections/functionalities.tex @@ -26,9 +26,30 @@ \end{frame} \begin{frame}[fragile]{Result processing example} +\begin{columns} + \column{0.5\textwidth} \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{yaml} -- TBD: +- py_func: + name: Get device status + file: device.py + func_name: get_status + process_result: <|$(result)['temperature']|> + expected_result: 25.0 \end{minted} + \column{0.5\textwidth} + \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{yaml} +- console: + name: Read firmware version + console_name: serial_console + steps: + - writeln: version + - read_until: + expected: "version:" + timeout: 5 + process_result: <|$(result).split()[-1]|> + expected_result: "1.2.3" + \end{minted} +\end{columns} \end{frame} \begin{frame}[fragile]{Includes} diff --git a/src/sections/intro.tex b/src/sections/intro.tex index ab5633b..faf1b30 100644 --- a/src/sections/intro.tex +++ b/src/sections/intro.tex @@ -270,7 +270,7 @@ report: \end{itemize} \end{frame} -% ===== Links for documentation / code =====evaluation and +% ===== Links for documentation / code ===== \subsection{Documentation and example code} \begin{frame}{Links for documentation and example code} diff --git a/src/sections/items.tex b/src/sections/items.tex index 8cfb9ad..091e274 100644 --- a/src/sections/items.tex +++ b/src/sections/items.tex @@ -93,8 +93,10 @@ \end{itemize} \item \incode{loop} test item specific variables \begin{itemize} - \item \incode{loop\_index} : loop index (starting from 0) - \item \incode{loop\_param} : current value of the loop iterator + \item \incode{loop\_index} : loop index (starting from 0) + \item \incode{loop\_index\_inverse} : loop index in reverse order + \item \incode{loop\_count} : total number of iterations + \item \incode{loop\_param} : current value of the loop iterator \end{itemize} \end{itemize} \end{frame} @@ -187,9 +189,16 @@ def dummy_func(param1, param2, param4, param4): \begin{frame}[fragile]{\incode{lua\_func} test item function call} \begin{itemize} - \item Calls the a lua function from a module + \item The lua file must import helper's module \incode{testium} + \item Calls a Lua function by its name \begin{minted}[fontsize=\fontsize{6}{7}\selectfont]{lua} tm = require("testium") + +function dummy_func(param1, param2) + local value = tm.gd("global_dict_key") + ... + return 10 +end \end{minted} \begin{itemize} \item To get a variable from the global dictionnary : \incode{tm.gd("global\_dict\_key")} diff --git a/testium_training.pdf b/testium_training.pdf index 421420c..186ed60 100644 Binary files a/testium_training.pdf and b/testium_training.pdf differ