#  Copyright 2020 Modelling, Simulation and Design Lab (MSDL) at
#  McGill University and the University of Antwerp (http://msdl.cs.mcgill.ca/)
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS,
#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#  See the License for the specific language governing permissions and
#  limitations under the License.

"""Tests for ``Python(P)DEVS-BBL``.

Execute this file to accurately set the pythonpath and run the tests.
By default, the ``dependencies`` directory is ignored and verbosity
is enabled. Pass additional ``pytest`` arguments to run the tests you
require.

Note:
    The :mod:`test.extra.test_mathutils` module takes a while to
    execute. See its documentation for more details.

    Likewise, the tests in the :mod:`test.extra.test_distributions` may
    take slightly longer than expected. Especially the tests for the
    `binomial`, `pearson6`, `johnsonU`, `johnsonB` and `negbinomial`
    distributions. This is mainly due to a large amount of parameters
    that's being tested.

.. code-block:: bash

    # To execute only the 'fast' tests of the generic package
    # Execute from the 'src/test' folder.

    python3 __init__.py --ignore=extra/test_mathutils.py --ignore=extra/test_distributions.py .
"""

import os
import sys

if os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) == os.getcwd(): # INSIDE SRC DIR
    sys.path.insert(0, os.path.abspath('.'))
    sys.path.insert(0, os.path.abspath('./dependencies/pythonpdevs/src'))
elif os.path.abspath(os.path.dirname(__file__)) == os.getcwd(): # INSIDE TEST DIR
    sys.path.insert(0, os.path.abspath('..'))
    sys.path.insert(0, os.path.abspath('../dependencies/pythonpdevs/src'))

import pytest

if __name__ == '__main__':
    args = ["--ignore=dependencies", '-v'] + sys.argv
    pytest.main(args)
