Skip to content

Commit

Permalink
add tests with pytest
Browse files Browse the repository at this point in the history
Signed-off-by: Unai Martinez-Corral <[email protected]>
  • Loading branch information
umarcor committed Apr 24, 2022
1 parent 8f5bf07 commit 7027335
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,5 @@ jobs:
run: |
. ./.github/scripts/activate.sh
for tool in place route synth write-fasm; do
echo "::group::Test f4pga-$tool"
"f4pga-$tool" || echo "Failing?"
echo "::endgroup::"
done;
pip3 install -r ./test/requirements.txt
pytest -vsrA --color=yes test/wrappers.py
1 change: 1 addition & 0 deletions test/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
46 changes: 46 additions & 0 deletions test/wrappers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from pytest import mark
from sys import stdout, stderr

from subprocess import check_call


@mark.xfail
@mark.parametrize("wrapper", ['place', 'route', 'synth', 'write-fasm'])
def test_wrapper(wrapper):
print(f"\n::group::Test {wrapper}")
stdout.flush()
stderr.flush()
try:
check_call(f"f4pga-{wrapper}")
finally:
print("\n::endgroup::")


@mark.xfail
@mark.parametrize(
"wrapper",
[
'symbiflow_generate_constraints',
'symbiflow_pack',
'symbiflow_place',
'symbiflow_route',
'symbiflow_synth',
'symbiflow_write_bitstream',
'symbiflow_write_fasm',
'symbiflow_write_xml_rr_graph',
'vpr_common',
'symbiflow_analysis',
'symbiflow_repack',
'symbiflow_generate_bitstream',
'symbiflow_generate_libfile',
'ql_symbiflow'
]
)
def test_shell_wrapper(wrapper):
print(f"\n::group::Test {wrapper}")
stdout.flush()
stderr.flush()
try:
check_call(f"{wrapper}")
finally:
print("\n::endgroup::")

0 comments on commit 7027335

Please sign in to comment.