Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README to test directory #252

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
.github/**
LICENSES/**
.gitignore
*.md
autogen.sh
pytest.ini
*.yapf
COPYING*
*/*.md
- name: Run license review
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
Expand Down
30 changes: 30 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Running tests with pytest

To run tests suite, make sure python and pytest with at least 3.11 version is installed.

## How to compile with tests enabled

Run `autogen.sh` to generate compilation configurations.
Run `./configure` with `--enable-test` to enable building unit tests and add a target for `make check`. This option requires `--enable-library` too.
Compile with `make` or `make check` when you want to run unit tests just after compilation.

## Parameters to configure

There is possibility to set:

- `--ledctl-binary` - path to ledctl,
- `--slot-filters` - comma separated list of slot filters to exclude,
- `--controller-filters` - comma separated list of controller types to exclude.


## How to run tests

There are few methods to run tests:

- run `pytest` with or without parameters to set,

```shell
$ pytest --ledctl-binary=src/ledctl/ledctl --slot-filters=sg3-,sg2- --controller-filters=VMD
```
- run `make check` which will compile the code and run tests. Logs will be placed in `./test-suite.log` file,
- run script `tests/runtests.sh`.