#!/bin/sh
#
# Run tests for continuous integration.
#
# This script is normally run in a test container, such as in Travis-CI.
#
# SPDX-License-Identifier: MIT

set -eux

# Configure the build.
export AUTHOR_TESTING=1
export C_TAP_VERBOSE=1
export REMCTL_PYTHON_VERSIONS="python2 python3"

# Build everything.
./bootstrap
./configure --enable-perl --enable-php --enable-python --enable-ruby
make warnings

# Run the regular tests.
make check

# Run additional Python coding style tests, but only in the non-Clang build.
if [ "$TRAVIS_COMPILER" = "gcc" ]; then
    cd python
    mypy .
    mypy --py2 .
    black --check .
    flake8
    cd ..
fi
