#!/bin/bash
###############################################################################
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
###############################################################################
# Run basic tests on base.

if [ "$0" = "$BASH_SOURCE" ]
then
  set -o errexit
else
  echo "Warning: This script should not be sourced. Skipping exit on error."
fi


SCRIPT_DIR="$( cd "$(dirname "${BASH_SOURCE[0]:-$0}")" >/dev/null 2>&1 ; pwd -P )"

# Read command line options
. "${SCRIPT_DIR}/_buildopts.sh" \
    --name test \
    --desc "Run basic tests on base." \
    -- "$@"

###############################################################################
# Globals
if [ -z "${VPL_DISP_BUILD_DIR}" ]
then
  VPL_DISP_BUILD_DIR="${PROJ_DIR}/_build"
fi
###############################################################################

BUILD_DIR="${VPL_DISP_BUILD_DIR}"
pushd "${BUILD_DIR}"
  ctest  --config "${COFIG_OPT}" -T test
  result_all=$?
popd

exit $result_all
