Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
79a354e
refactor(tropic01_model): moved config-related files to scripts/tropi…
andreondra Jan 6, 2026
8b1337e
examples(model): added hello world.
andreondra Jan 6, 2026
fd5ef9c
scripts: added model installation script for Linux.
andreondra Jan 6, 2026
719119c
scripts: added default model config.
andreondra Jan 6, 2026
9e13ee7
refactor: move model_runner
andreondra Jan 6, 2026
2e010d7
tests(model): initial config.
andreondra Jan 6, 2026
a303f50
fix(functional tests): ASAN config.
andreondra Jan 6, 2026
4c65506
refactor(model): removed old main.c.
andreondra Jan 6, 2026
7b6f39b
refactor(integration_tests.yml): reflected structure changes.
andreondra Jan 6, 2026
9ed0828
refactor(integration_tests.yml): add temp branch.
andreondra Jan 6, 2026
e1bf299
refactor(integration_tests.yml): add pyaml dependency.
andreondra Jan 6, 2026
f777538
refactor: clang-format.
andreondra Jan 6, 2026
4b3e677
ci(integration_tests): activate venv where required.
andreondra Jan 6, 2026
e5a6b76
ci(integration_tests): remove temporary trigger
andreondra Jan 6, 2026
e37b189
ci(coverage): reflect structural changes.
andreondra Jan 6, 2026
886ce41
ci(coverage): fix gcovr params.
andreondra Jan 6, 2026
06a284a
refactor(functional_mock_tests): remove symlink to Libtropic.
andreondra Jan 6, 2026
ced628a
ci(coverage): remove temp trigger.
andreondra Jan 7, 2026
13c09e7
ci(run_examples): reflected structural changes.
andreondra Jan 7, 2026
3ef4e76
ci(coverage): added temp trigger for debugging.
andreondra Jan 7, 2026
2bbbab8
ci(run_examples): added backslashes for escaping newlines
andreondra Jan 7, 2026
a065a52
ci(run_examples): use valgrind, correct run_logs path.
andreondra Jan 7, 2026
2813618
ci(run_examples): escape backslash.
andreondra Jan 7, 2026
262d629
ci(run_examples): install valgrind.
andreondra Jan 7, 2026
21f58eb
ci(run_examples): rename run_logs.
andreondra Jan 7, 2026
72a8834
doc(code_coverage): update gcovr commands.
andreondra Jan 7, 2026
eccacfe
ci(run_examples): remove temp trigger.
andreondra Jan 7, 2026
da887df
refactor: remove tropic01_model directory from repo root.
andreondra Jan 7, 2026
b86cd7c
refactor(functional tests, model): change __lt_handle__ to pointer.
andreondra Jan 7, 2026
91a59e8
build(functional tests, model): fixed comments, logging
andreondra Jan 7, 2026
e9609f8
scripts(install_linux): remove spellcheck settings.
andreondra Jan 7, 2026
3b15afc
build(model/hello_world): clarified compat message.
andreondra Jan 7, 2026
72ac3f6
doc(functional tests/model): added file description.
andreondra Jan 7, 2026
1bc05f0
doc: moved tropic01_model information to a tutorial.
andreondra Jan 7, 2026
9561473
doc(model): added installation guide, added tabs for platform-specifi…
andreondra Jan 8, 2026
90175fd
doc(model): added tutorial 2. link
andreondra Jan 8, 2026
f7f7290
doc(changelog): added mention of moving model.
andreondra Jan 8, 2026
d7857fd
ci: add ninja-build to dependencies.
andreondra Jan 8, 2026
de8e85d
doc(model): typo
andreondra Jan 8, 2026
37925ac
doc(model): fix paths
andreondra Jan 8, 2026
077ecfa
doc(model): fix paths
andreondra Jan 8, 2026
a9032ad
doc(model): typo
andreondra Jan 8, 2026
f4b957c
ci(run_examples): remove redundant path.
andreondra Jan 8, 2026
0e15222
build(functional tests/model): fixed test properties.
andreondra Jan 8, 2026
03d80b6
scripts(download_deps): use hash/checksum
andreondra Jan 8, 2026
3db8844
fix(functional/model): add prng seed
andreondra Jan 9, 2026
b62f67f
fix(examples/model/hello_world): add file doxy tag
andreondra Jan 9, 2026
1bfda1b
doc: fixed provisioning data link
andreondra Jan 9, 2026
a8d6e07
doc: clarifications, wording.
andreondra Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 11 additions & 22 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,52 +40,41 @@ jobs:
with:
python-version: '3.12'

- name: Download ts-tvl wheel
run: |
curl -s "https://api.github.com/repos/tropicsquare/ts-tvl/releases/tags/2.3" > release.json

WHEEL_URL=$(jq -r '.assets[] | select(.name | endswith(".whl")) | .browser_download_url' release.json)
if [ -z "$WHEEL_URL" ]; then
echo "No .whl file found in the release." >&2
exit 1
fi

WHEEL_FILE_NAME=$(basename "$WHEEL_URL")
echo "WHEEL_FILE_NAME=$WHEEL_FILE_NAME" >> $GITHUB_ENV
curl -L -o "$WHEEL_FILE_NAME" "$WHEEL_URL"

- name: Install dependencies
run: |
sudo apt-get install cmake build-essential
pip install ${{ env.WHEEL_FILE_NAME }}
sudo apt-get install cmake build-essential ninja-build
./tests/functional/model/download_deps.sh
./scripts/tropic01_model/install_linux.sh
source ./scripts/tropic01_model/.venv/bin/activate
pip install gcovr jsonschema

- name: Compile and run functional tests with coverage enabled, export trace
run: |
cd tropic01_model/
source ./scripts/tropic01_model/.venv/bin/activate
cd tests/functional/model/
cmake ./ -B build -G Ninja -DLT_CAL=mbedtls_v4 -DLT_BUILD_TESTS=1 -DLT_TEST_COVERAGE=1
cd build/
ninja
ctest -V

cd ..
gcovr --json coverage_trace.json --exclude 'build/_deps/.*|\.\./tests/.*|\.\./vendor/.*|\.\./hal/.*|\.\./cal/.*'
gcovr --json coverage_trace.json --exclude '.*_deps/.*|.*cal/.*|.*hal/.*' -r ../../../..

- name: Compile and run functional mock tests with coverage enabled, export trace
run: |
source ./scripts/tropic01_model/.venv/bin/activate
cd tests/functional_mock
mkdir -p build
cd build
cmake -G Ninja -DLT_TEST_COVERAGE=1 ..
ninja
ctest -V

cd ..
gcovr --json coverage_trace.json --exclude 'build/_deps/.*|\.\./tests/.*|\.\./vendor/.*|\.\./\.\./hal/.*|\.\./\.\./cal/.*'
gcovr --json coverage_trace.json --exclude '.*_deps/.*|.*cal/.*|.*hal/.*' -r ../../..

- name: Merge coverage and generate markdown report
run: |
gcovr --json-add-tracefile tropic01_model/coverage_trace.json --json-add-tracefile tests/functional_mock/coverage_trace.json --markdown coverage_report.md
source ./scripts/tropic01_model/.venv/bin/activate
gcovr --json-add-tracefile tests/functional_mock/build/coverage_trace.json --json-add-tracefile tests/functional/model/build/coverage_trace.json --markdown coverage_report.md

- name: Post or update PR comment
uses: actions/github-script@v7
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/functional_mock_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get install cmake build-essential
sudo apt-get install cmake build-essential ninja-build
pip install jsonschema jinja2

- name: Compile functional mock tests with AddressSanitizer
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Install dependencies
run: |
sudo apt-get install cmake build-essential valgrind
sudo apt-get install cmake build-essential valgrind ninja-build
pip install jsonschema jinja2

- name: Compile functional mock tests with Valgrind
Expand Down
60 changes: 20 additions & 40 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,44 +24,34 @@ jobs:
with:
python-version: '3.8'

- name: Download ts-tvl wheel
run: |
curl -s "https://api.github.com/repos/tropicsquare/ts-tvl/releases/tags/2.3" > release.json

WHEEL_URL=$(jq -r '.assets[] | select(.name | endswith(".whl")) | .browser_download_url' release.json)
if [ -z "$WHEEL_URL" ]; then
echo "No .whl file found in the release." >&2
exit 1
fi

WHEEL_FILE_NAME=$(basename "$WHEEL_URL")
echo "WHEEL_FILE_NAME=$WHEEL_FILE_NAME" >> $GITHUB_ENV
curl -L -o "$WHEEL_FILE_NAME" "$WHEEL_URL"

- name: Install dependencies
run: |
sudo apt-get install cmake build-essential
pip install ${{ env.WHEEL_FILE_NAME }}
sudo apt-get install cmake build-essential ninja-build
./tests/functional/model/download_deps.sh
./scripts/tropic01_model/install_linux.sh
source ./scripts/tropic01_model/.venv/bin/activate
pip install jsonschema

- name: Compile libtropic with tests and AddressSanitizer
run: |
cd tropic01_model/
cmake ./ -B build -G Ninja -DLT_CAL=mbedtls_v4 -DLT_BUILD_TESTS=1 -DCMAKE_BUILD_TYPE=Debug -DLT_ASAN=1
source ./scripts/tropic01_model/.venv/bin/activate
cd tests/functional/model/
cmake ./ -B build -G Ninja -DLT_CAL=mbedtls_v4 -DCMAKE_BUILD_TYPE=Debug -DLT_ASAN=1
cd build/
ninja

- name: Execute tests with CTest
run: |
cd tropic01_model/build/
source ./scripts/tropic01_model/.venv/bin/activate
cd tests/functional/model/build
ctest -V

- name: Upload run logs
if: always()
uses: actions/upload-artifact@v4
with:
name: asan_run_logs
path: tropic01_model/build/run_logs/
path: tests/functional/model/build/run_logs

tests_valgrind:
name: Run tests with Valgrind
Expand All @@ -77,41 +67,31 @@ jobs:
with:
python-version: '3.8'

- name: Download ts-tvl wheel
run: |
curl -s "https://api.github.com/repos/tropicsquare/ts-tvl/releases/tags/2.3" > release.json

WHEEL_URL=$(jq -r '.assets[] | select(.name | endswith(".whl")) | .browser_download_url' release.json)
if [ -z "$WHEEL_URL" ]; then
echo "No .whl file found in the release." >&2
exit 1
fi

WHEEL_FILE_NAME=$(basename "$WHEEL_URL")
echo "WHEEL_FILE_NAME=$WHEEL_FILE_NAME" >> $GITHUB_ENV
curl -L -o "$WHEEL_FILE_NAME" "$WHEEL_URL"

- name: Install dependencies
run: |
sudo apt-get install cmake build-essential valgrind
pip install ${{ env.WHEEL_FILE_NAME }}
sudo apt-get install cmake build-essential valgrind ninja-build
./tests/functional/model/download_deps.sh
./scripts/tropic01_model/install_linux.sh
source ./scripts/tropic01_model/.venv/bin/activate
pip install jsonschema

- name: Compile libtropic with tests and Valgrind
run: |
cd tropic01_model/
cmake ./ -B build -G Ninja -DLT_CAL=mbedtls_v4 -DLT_BUILD_TESTS=1 -DCMAKE_BUILD_TYPE=Debug -DLT_VALGRIND=1
source ./scripts/tropic01_model/.venv/bin/activate
cd tests/functional/model/
cmake ./ -B build -G Ninja -DLT_CAL=mbedtls_v4 -DCMAKE_BUILD_TYPE=Debug -DLT_VALGRIND=1
cd build/
ninja

- name: Execute tests with CTest
run: |
cd tropic01_model/build/
source ./scripts/tropic01_model/.venv/bin/activate
cd tests/functional/model/build
ctest -V

- name: Upload run logs
if: always()
uses: actions/upload-artifact@v4
with:
name: valgrind_run_logs
path: tropic01_model/build/run_logs/
path: tests/functional/model/build/run_logs
125 changes: 16 additions & 109 deletions .github/workflows/run_examples.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run examples against TROPIC01 model
name: Run examples for TROPIC01 model
on:
push:
branches:
Expand All @@ -11,7 +11,7 @@ on:

jobs:
examples_asan:
name: Run examples with AddressSanitizer
name: Compile and run examples for TROPIC01 model with Valgrind
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -24,123 +24,30 @@ jobs:
with:
python-version: '3.8'

- name: Download ts-tvl wheel
run: |
curl -s "https://api.github.com/repos/tropicsquare/ts-tvl/releases/tags/2.3" > release.json

WHEEL_URL=$(jq -r '.assets[] | select(.name | endswith(".whl")) | .browser_download_url' release.json)
if [ -z "$WHEEL_URL" ]; then
echo "No .whl file found in the release." >&2
exit 1
fi

WHEEL_FILE_NAME=$(basename "$WHEEL_URL")
echo "WHEEL_FILE_NAME=$WHEEL_FILE_NAME" >> $GITHUB_ENV
curl -L -o "$WHEEL_FILE_NAME" "$WHEEL_URL"

- name: Install dependencies
run: |
sudo apt-get install cmake build-essential
pip install ${{ env.WHEEL_FILE_NAME }}
sudo apt-get install cmake build-essential valgrind ninja-build
./tests/functional/model/download_deps.sh
./scripts/tropic01_model/install_linux.sh
source ./scripts/tropic01_model/.venv/bin/activate
pip install jsonschema

- name: Compile libtropic with examples and AddressSanitizer
- name: Compile and run Hello World example
run: |
cd tropic01_model/
cmake ./ -B build -G Ninja -DLT_CAL=mbedtls_v4 -DLT_BUILD_EXAMPLES=1 -DCMAKE_BUILD_TYPE=Debug -DLT_ASAN=1
source ./scripts/tropic01_model/.venv/bin/activate
cd examples/model/hello_world
cmake ./ -B build -G Ninja
cd build/
ninja

- name: Create configuration for the model
run: |
cd tropic01_model/build/
LAB_BATCH_PKG_DIR=$(cmake -LAH .. | grep '^LAB_BATCH_PKG_DIR:' | cut -d'=' -f2)
echo "LAB_BATCH_PKG_DIR=$LAB_BATCH_PKG_DIR" >> $GITHUB_ENV
python3 ../create_model_cfg.py --pkg-dir "$LAB_BATCH_PKG_DIR" --riscv-fw-ver 2.0.0 --model-cfg ./model_cfg.yml

- name: Execute each example
run: |
cd tropic01_model/build/
for exe in ./lt_ex_*; do
if [[ -x "$exe" && ! -d "$exe" ]]; then
python3 ../../scripts/model_runner.py \
-e "$exe" \
-c model_cfg.yml \
-o run_logs/
fi
done

- name: Upload run logs
if: always()
uses: actions/upload-artifact@v4
with:
name: asan_run_logs
path: tropic01_model/build/run_logs/

examples_valgrind:
name: Run examples with Valgrind
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
submodules: recursive

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.8'

- name: Download ts-tvl wheel
run: |
curl -s "https://api.github.com/repos/tropicsquare/ts-tvl/releases/tags/2.3" > release.json

WHEEL_URL=$(jq -r '.assets[] | select(.name | endswith(".whl")) | .browser_download_url' release.json)
if [ -z "$WHEEL_URL" ]; then
echo "No .whl file found in the release." >&2
exit 1
fi

WHEEL_FILE_NAME=$(basename "$WHEEL_URL")
echo "WHEEL_FILE_NAME=$WHEEL_FILE_NAME" >> $GITHUB_ENV
curl -L -o "$WHEEL_FILE_NAME" "$WHEEL_URL"

- name: Install dependencies
run: |
sudo apt-get install cmake build-essential valgrind
pip install ${{ env.WHEEL_FILE_NAME }}
pip install jsonschema

- name: Compile libtropic with examples
run: |
cd tropic01_model/
cmake ./ -B build -G Ninja -DLT_CAL=mbedtls_v4 -DLT_BUILD_EXAMPLES=1 -DCMAKE_BUILD_TYPE=Debug
cd build/
ninja

- name: Create configuration for the model
run: |
cd tropic01_model/build/
LAB_BATCH_PKG_DIR=$(cmake -LAH .. | grep '^LAB_BATCH_PKG_DIR:' | cut -d'=' -f2)
echo "LAB_BATCH_PKG_DIR=$LAB_BATCH_PKG_DIR" >> $GITHUB_ENV
python3 ../create_model_cfg.py --pkg-dir "$LAB_BATCH_PKG_DIR" --riscv-fw-ver 2.0.0 --model-cfg ./model_cfg.yml

- name: Execute each example
run: |
cd tropic01_model/build/
for exe in ./lt_ex_*; do
if [[ -x "$exe" && ! -d "$exe" ]]; then
python3 ../../scripts/model_runner.py \
-e "$exe" \
-c model_cfg.yml \
-o run_logs/ \
--use-valgrind
fi
done
python3 ../../../../scripts/tropic01_model/model_runner.py \
-e ./libtropic_hello_world \
-c ../../../../scripts/tropic01_model/model_cfg.yml \
-o run_logs/ \
--use-valgrind

- name: Upload run logs
if: always()
uses: actions/upload-artifact@v4
with:
name: valgrind_run_logs
path: tropic01_model/build/run_logs/
path: examples/model/hello_world/build/run_logs/
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ docs_build/
venv/
__pycache__/
.model_config_save.yaml
model_cfg.yml
*.whl
_deps/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
about if and how the LF is translated automatically (e.g., `stdio.h` implementation of major desktop platforms) or if you
need to modify the behavior yourself (e.g., by modifiying `_write` syscall on STM32), or (in the case of the embedded platforms)
you just need to configure your serial monitor correctly, so it expects only LF character (and not CR+LF pair).
- Moved TROPIC01 Model related files to `scripts/tropic01_model`.

### Added
- Logging: `lt_port_log` function for platform-specific logging mechanism; is used by the logging macros declared in `libtropic_logging.h`.
Expand Down
10 changes: 5 additions & 5 deletions docs/for_contributors/tests/code_coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ ctest -V

After CTest finishes, use [gcovr](https://github.com/gcovr/gcovr) to export results:
```shell
# Execute this from the tropic01_model/ directory!
gcovr --json coverage_trace.json --exclude 'build/_deps/.*|\.\./tests/.*|\.\./vendor/.*|\.\./hal/.*|\.\./cal/.*'
# Execute this from the tests/functional/model/build directory!
gcovr --json coverage_trace.json --exclude '.*_deps/.*|.*cal/.*|.*hal/.*' -r ../../../..
```

## Running Functional Mock Tests
Expand All @@ -40,16 +40,16 @@ ctest -V

After CTest finishes, use [gcovr](https://github.com/gcovr/gcovr) to export results:
```shell
# Execute this from the tests/functional_mock directory!
gcovr --json coverage_trace.json --exclude 'build/_deps/.*|\.\./tests/.*|\.\./vendor/.*|\.\./\.\./hal/.*|\.\./\.\./cal/.*'
# Execute this from the tests/functional_mock/build directory!
gcovr --json coverage_trace.json --exclude '.*_deps/.*|.*cal/.*|.*hal/.*' -r ../../..
```

## Merging and Exporting Total Coverage
Use the following command to merge results and export in text format:

```shell
# Execute this from the repository root (or adjust paths accordingly)
gcovr --json-add-tracefile tropic01_model/coverage_trace.json --json-add-tracefile tests/functional_mock/coverage_trace.json --txt coverage.txt
gcovr --json-add-tracefile tests/functional_mock/build/coverage_trace.json --json-add-tracefile tests/functional/model/build/coverage_trace.json --txt coverage.txt
```

!!! tip "Tip: Gcovr Output Formats"
Expand Down
Loading