#!/bin/bash
# -*-sh-*-

export MAKEFLAGS=""
status=0

source ./common/TEST_ENV || exit 1
source ./common/functions || exit 1

cd dev-tools/numpy || exit 1
export BATS_JUNIT_CLASS=Numpy

for compiler in ${COMPILER_FAMILIES}; do
	for python in ${PYTHON_FAMILIES}; do

		echo " "
		echo " "
		echo "----------------------------------------------------------"
		echo "Dev tools: ${python}-Numpy tests: ${compiler}"
		echo "----------------------------------------------------------"

		get_python_vars "${python}"

		module purge || exit 1
		module load "${compiler}" || exit 1
		# shellcheck disable=SC2154
		module load "${python_module_prefix}-numpy" || exit 1

		./bootstrap || exit 1
		./configure || exit 1
		make clean || exit 1
		make -k check || status=1

		save_logs_compiler_family tests "${python}-${compiler}"

		make distclean
	done
done

exit "${status}"
