1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
#!/bin/bash
###############################################################################
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: MIT
###############################################################################
# Run the test suite.
#
# Scope can be limited by providing subset of tests as argumene from among:
# lint, unit
set -o errexit ; set -o nounset
if [ -z "$BASH_VERSION" ]; then
echo "This script must be run under bash"
exit 1
fi
script_dir="$( cd "$(dirname "${BASH_SOURCE[0]:-$0}")" >/dev/null 2>&1 ; pwd -P )"
source_dir="$(dirname "$script_dir")"
build_dir="$source_dir/_build"
if [ $# -eq 0 ]; then
# if no arguments provided enable all testing
do_lint=true
do_unit=true
else
do_lint=false
do_unit=false
fi
while test $# -gt 0
do
case "$1" in
lint) do_lint=true
;;
unit) do_unit=true
;;
*) echo "invalid option: '$1'";
exit 1
;;
esac
shift
done
if [ "$do_lint" = true ] ; then
"$source_dir/script/lint"
fi
if [ "$do_unit" = true ] ; then
ctest --test-dir "$build_dir" --C Release --output-on-failure -T test
fi
|