Skip to content
Snippets Groups Projects
Commit 4283aed8 authored by Oscar Gustafsson's avatar Oscar Gustafsson :bicyclist:
Browse files

Add code coverage to PRs

parent 5d38abf4
No related branches found
No related tags found
1 merge request!91Add code coverage to PRs
Pipeline #87809 passed
......@@ -4,23 +4,31 @@ stages:
before_script:
- apt-get update --yes
- apt-get install --yes build-essential cmake libfmt-dev pybind11-dev graphviz python3-pyqt5 xvfb xdg-utils
- apt-get install --yes build-essential cmake libfmt-dev pybind11-dev graphviz python3-pyqt5 xvfb xdg-utils lcov
- python -m pip install --upgrade pip
- python --version
- pip install pytest pytest-cov sphinx furo numpydoc pytest-xvfb pytest-qt setuptools_scm sphinx-qt-documentation pytest-xdist
- pip install .
# - export CXXFLAGS='--coverage'
- pip install -ve .
# Move file, but should be handled by installation
- mv _b_asic* b_asic
- pip show b_asic
.run-test:
stage: test
script:
- pytest --cov=b_asic --cov-report xml:cov.xml --cov-report term test
- sphinx-build -b html docs_sphinx public
- pytest --cov=b_asic --cov-report=xml:cov.xml --cov-report=term --color=yes test
# - lcov --capture --directory . --output-file coverage.info
# - lcov --output-file coverage.info --extract coverage.info $PWD/src/'*' $PWD/b_asic/'*'
# - lcov --list coverage.info
# - find . -name '*.gc*' -delete
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: cov.xml
coverage: /(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/
run-test-3.8:
image: python:3.8
......@@ -34,6 +42,12 @@ run-test-3.10:
image: python:3.10
extends: ".run-test"
run-doc-test:
image: python:3.10
stage: test
script:
- sphinx-build -b html docs_sphinx public
#run-test-3.11:
# image: python:3.11
# extends: ".run-test"
......
......@@ -93,7 +93,7 @@ endif()
# Copy binaries to project folder for debugging during development.
if(NOT ASIC_BUILDING_PYTHON_DISTRIBUTION)
add_custom_target(copy_binaries ALL
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${TARGET_NAME}>" "${CMAKE_CURRENT_LIST_DIR}"
COMMENT "Copying binaries to ${CMAKE_CURRENT_LIST_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${TARGET_NAME}>" "${CMAKE_CURRENT_LIST_DIR}/${LIBRARY_NAME}"
COMMENT "Copying binaries to ${CMAKE_CURRENT_LIST_DIR}/${LIBRARY_NAME}"
DEPENDS "${TARGET_NAME}")
endif()
......@@ -5,7 +5,7 @@ ASIC toolbox that simplifies circuit design and optimization.
# NOTE: If this import gives an error,
# make sure the C++ module has been compiled and installed properly.
# See the included README.md for more information on how to build/install.
from _b_asic import *
from b_asic._b_asic import *
# Python modules.
from b_asic.core_operations import *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment