-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(examples): Add simple README w instructions
This should hopefully make it clear how to use the given example Signed-off-by: Stefan Kraus <[email protected]>
- Loading branch information
1 parent
8fc6e25
commit 9d35993
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Fretish robot examples | ||
|
||
This folder contains some examples to demonstrate the use of `fret-to-robot`. | ||
|
||
## Preparation | ||
|
||
You should be familiar with Zephyr and the basic setup as described in the | ||
(Getting Started Guide)[https://docs.zephyrproject.org/latest/develop/getting_started/index.html]. | ||
|
||
For a setup in an example, create a virtual environment, source it, and install `west` (Step 1 - 5) | ||
in the Getting Started Guide. | ||
|
||
Now, also install the `fretish_robot` library. If you are in the current directory, do | ||
this by calling | ||
|
||
``` | ||
pip install ../ | ||
``` | ||
|
||
Then, create a new workspace for the example by calling (e.g. for digital_microscope) | ||
|
||
```sh | ||
west init -l digital_microscope | ||
west update | ||
``` | ||
|
||
This also fetches a zephyr with (currently custom) `robotframework` harness support for twister, and all | ||
necessary modules | ||
|
||
## Creating tests for example | ||
|
||
To create robot tests for an example, move into the `assets` folder of the example and call `fret-to-robot` | ||
properly. For example: | ||
|
||
```sh | ||
fret-to-robot req_fret.json --extra-libraries DigitalMicroscopeLib | ||
``` | ||
|
||
The `extra-libraries` argument is necessary as we implement keyword functionality in a library | ||
called `DigitalMicroscopeLib` (see `assets/robot_files/DigitalMicroscopeLib.py`) | ||
|
||
Now, the generated files can be found in `assets/robot_files/tests.robot` | ||
|
||
## Execute tests | ||
|
||
Now, you can execute the tests with a proper twister execution. | ||
|
||
To execute all tests for `native_sim_64` platform, do | ||
|
||
``` | ||
PYTHONPATH=digital_microscope/assets/robot_files west twister -p native_sim_64 -vvv -c -T digital_microscope/ | ||
``` | ||
|
||
The setting of `PYTHONPATH` is necessary as we have a custom library for implementation, | ||
`-vvv` makes it more verbose to see progress. | ||
|
||
Afterwards, the results of the test executions are shown (4 of 15 fail, as `always` FRET keyword is not implemented) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Digital Microscope | ||
|
||
This is a simple example of a digital microscope that functioned as an | ||
example in the conference talk "Level Up Your Embedded Testing Game: | ||
FRETish, Robot, and Twister: A Dream Team" on the "Open Source Summit Europe 2024" | ||
|
||
This is just for illustration purposes of FRET to RobotFramework tests | ||
and does not guarantee correctness or best-practices of Zephyr. |