#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2023 Marcel Telka
#

%patch% 02-test-sysdir.patch
%patch% 03-test-cmake.patch

%include-3%
# https://github.com/scikit-build/scikit-build/issues/951
PYTEST_ADDOPTS += -W ignore::DeprecationWarning
# We usually do have setuptools-scm installed so we need to disable tests that
# expect setuptools-scm is not installed.
PYTEST_ADDOPTS += -m 'not nosetuptoolsscm'
# pep518 tests are trying to install numpy using pip, but that fails during
# numpy compilation.
PYTEST_ADDOPTS += -k 'not pep518'
# These tests are trying to install numpy using pip, but that fails because of
# https://github.com/numpy/numpy/issues/25366
PYTEST_ADDOPTS += --ignore tests/test_distribution.py

# Testing needs to compile some C++ sources
COMPONENT_TEST_ENV += CXX="$(CXX)"
# and it also needs fortran
COMPONENT_TEST_ENV += FC="$(FC)"

# This project does not support tox so we need to provide test requirements
# manually.
TEST_REQUIREMENTS_EXTRAS += test