gnu: python-vunit: Add example checks.

* gnu/packages/electronics.scm (python-vunit)[arguments]: Complete
run-examples #:phase.

Change-Id: I7e9f3ea1e80f8622fa3206e743512683ca325dc7
Signed-off-by: Maxim Cournoyer <maxim@guixotic.coop>
This commit is contained in:
Cayetano Santos 2025-09-24 16:56:19 +02:00 committed by Maxim Cournoyer
parent 5d113af08c
commit c0faac0d84
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -1726,6 +1726,10 @@ to enforce it.")
(build-system pyproject-build-system)
(arguments
(list
#:modules '((guix build pyproject-build-system)
(guix build utils)
(ice-9 ftw)
(srfi srfi-26))
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-ghdl-jit
@ -1751,14 +1755,27 @@ to enforce it.")
(string-append site-packages "osvvm")))))
(add-after 'check 'run-examples
;; Run examples as an extra check.
(lambda* (#:key inputs outputs #:allow-other-keys)
(with-directory-excursion "examples/vhdl"
(for-each
(lambda (dir)
(invoke "python3" (string-append dir "/run.py")))
(list
"array" "check" "composite_generics" "json4vhdl" "logging"
"logging" "uart" "vhdl_configuration"))))))
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
(with-directory-excursion "examples/vhdl"
(for-each
(lambda (dir)
(invoke "python3" (string-append dir "/run.py"))
(delete-file-recursively "vunit_out"))
(scandir "."
(negate
(cut member <>
'("coverage" ;unsupported feature in nvc
"data_types" ;no run.py
"docker_runall.sh" ;not a test
"vivado" ;requires external tool
;; Fails with nvc
"array_axis_vcs"
"osvvm_log_integration"
"run"
"third_party_integration"
"user_guide"
"." ".."))))))))))
#:test-flags
;; Skip lint tests which require python-pycodestyle, python-pylint and
;; python-mypy to reduce closoure size; some lint test fails, see