Skip to content

Commit 7229e92

Browse files
Merge pull request #38 from eclipse-openxilenv/feature/python-api
feature: add python-api #11 #29
2 parents 929258f + 07c3c26 commit 7229e92

17 files changed

Lines changed: 9094 additions & 2046 deletions

File tree

.github/workflows/build.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
cd $GITHUB_WORKSPACE
7272
mkdir openxilenv-build
7373
cd openxilenv-build
74-
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/tools/OpenXilEnv ../openxilenv
74+
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/tools/OpenXilEnv ../openxilenv
7575
7676
- name: Build OpenXilEnv
7777
run: |
@@ -83,11 +83,22 @@ jobs:
8383
cd $GITHUB_WORKSPACE/openxilenv-build
8484
cmake --install .
8585
86+
- name: Test OpenXilEnv installation
87+
run: |
88+
cd $GITHUB_WORKSPACE/openxilenv
89+
export OPENXILENV_INSTALLATION_PATH=$GITHUB_WORKSPACE/tools/OpenXilEnv
90+
python3 -m venv .venv
91+
source .venv/bin/activate
92+
python3 -m pip install --upgrade pip
93+
python3 -m pip install -r ./requirements.txt
94+
python3 -m pip install ./python-api
95+
pytest -vv
96+
8697
- name: Upload artifacts
8798
uses: actions/upload-artifact@v4
8899
with:
89100
name: OpenXilEnv-Linux-Qt6_4_2
90-
path: ~/tools/OpenXilEnv/**
101+
path: ${{ github.workspace }}/tools/OpenXilEnv/**
91102

92103
windows-build:
93104
runs-on: windows-latest
@@ -163,6 +174,18 @@ jobs:
163174
cd D:\a\tools\OpenXilEnv
164175
windeployqt.exe XilEnvGui.exe
165176
177+
- name: Test OpenXilEnv installation
178+
shell: pwsh
179+
run: |
180+
cd D:\a\openxilenv\openxilenv\openxilenv
181+
$env:OPENXILENV_INSTALLATION_PATH = "D:\a\tools\OpenXilEnv"
182+
python -m venv .venv
183+
.\.venv\Scripts\Activate.ps1
184+
python -m pip install --upgrade pip
185+
python -m pip install -r ./requirements.txt
186+
python -m pip install ./python-api
187+
pytest -vv
188+
166189
- name: Upload artifacts
167190
uses: actions/upload-artifact@v4
168191
with:

Readme.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,39 @@ If not, use **LinuxRemoteMaster.out**.
6262

6363
Ensure **RemoteStartServer** is installed and running on the Linux PC to allow remote execution.
6464

65+
## Python API
66+
67+
OpenXilEnv is distributed with a python bindings wrapper that allows full control over a runninx openXilEnv instance via python.
68+
69+
The [functional tests](test/functional/) of openXilEnv are implemented in [pytest](https://docs.pytest.org/en/stable/) using the openXilEnv **python API** and provide an example usage.
70+
71+
For a detailed description take a look at the [openXilenv python API refrence](docs/PYTHON_API_REFERENCE.md).
72+
73+
## Test
74+
75+
OpenXilEnv provides functionality tests, that validate the **openXilEnv** installation using pytest.
76+
77+
The tests depend on the **openXilEnv Installation** path and the **openXilEnv Source** path.
78+
To make sure the paths are available, set the following variables
79+
80+
on windows
81+
```cmd
82+
set OPENXILENV_INSTALLATION_PATH="%SystemDrive%\dev\tools"
83+
set OPENXILENV_SOURCE_PATH="%SystemDrive%\dev\src"
84+
```
85+
86+
on linux
87+
```bash
88+
export OPENXILENV_SOURCE_PATH="$HOME/dev/src/openXilEnv"
89+
export OPENXILENV_INSTALLATION_PATH="$HOME/dev/tools/openXilEnv"
90+
```
91+
92+
To run all tests, simply execute
93+
94+
```bash
95+
pytest -vv
96+
```
97+
6598
## License
6699
This project is part of the Eclipse Foundation and licensed under the [Apache License 2.0](LICENSE.txt).
67100

0 commit comments

Comments
 (0)