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

Merge branch 'imagetests' into 'master'

Add image tests

See merge request !99
parents d85aebe4 0bfe843e
No related branches found
No related tags found
1 merge request!99Add image tests
Pipeline #88013 passed
...@@ -7,7 +7,7 @@ before_script: ...@@ -7,7 +7,7 @@ before_script:
- apt-get install --yes build-essential cmake libfmt-dev pybind11-dev graphviz python3-pyqt5 xvfb xdg-utils lcov - 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 -m pip install --upgrade pip
- python --version - python --version
- pip install pytest pytest-cov sphinx furo numpydoc pytest-xvfb pytest-qt setuptools_scm sphinx-qt-documentation pytest-xdist - pip install pytest pytest-cov sphinx furo numpydoc pytest-xvfb pytest-qt setuptools_scm sphinx-qt-documentation pytest-xdist pytest-mpl
# - export CXXFLAGS='--coverage' # - export CXXFLAGS='--coverage'
- pip install -ve . - pip install -ve .
# Move file, but should be handled by installation # Move file, but should be handled by installation
...@@ -17,7 +17,7 @@ before_script: ...@@ -17,7 +17,7 @@ before_script:
.run-test: .run-test:
stage: test stage: test
script: script:
- pytest --cov=b_asic --cov-report=xml:cov.xml --cov-report=term --color=yes test - pytest --cov=b_asic --cov-report=xml:cov.xml --cov-report=term --color=yes test --mpl
# - lcov --capture --directory . --output-file coverage.info # - lcov --capture --directory . --output-file coverage.info
# - lcov --output-file coverage.info --extract coverage.info $PWD/src/'*' $PWD/b_asic/'*' # - lcov --output-file coverage.info --extract coverage.info $PWD/src/'*' $PWD/b_asic/'*'
# - lcov --list coverage.info # - lcov --list coverage.info
......
...@@ -563,9 +563,12 @@ class Schedule: ...@@ -563,9 +563,12 @@ class Schedule:
) )
def plot_schedule(self) -> None: def plot_schedule(self) -> None:
self._get_figure().show()
def _get_figure(self):
fig, ax = plt.subplots() fig, ax = plt.subplots()
self._plot_schedule(ax) self._plot_schedule(ax)
fig.show() return fig
def _repr_svg_(self): def _repr_svg_(self):
fig, ax = plt.subplots() fig, ax = plt.subplots()
......
test/baseline/test__get_figure_no_execution_times.png

25.3 KiB

...@@ -467,3 +467,9 @@ class TestProcesses: ...@@ -467,3 +467,9 @@ class TestProcesses:
def test__get_memory_variables_list(self, secondorder_iir_schedule): def test__get_memory_variables_list(self, secondorder_iir_schedule):
mvl = secondorder_iir_schedule._get_memory_variables_list() mvl = secondorder_iir_schedule._get_memory_variables_list()
assert len(mvl) == 12 assert len(mvl) == 12
class TestFigureGeneration:
@pytest.mark.mpl_image_compare(remove_text=True, style='mpl20')
def test__get_figure_no_execution_times(self, secondorder_iir_schedule):
return secondorder_iir_schedule._get_figure()
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