Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HelpMessage() {
- echo "#######################################"
- echo "# Script runs the tests for Intel(R) ADL"
- echo "# Usage: ${BASH_SOURCE[1]} -o <OS> [-c <compiler>] [-a <arch>] [-i <isa>] [-m <mode>] [-d <domain>]"
- echo "# Args:"
- echo "# -o/--os - Target OS. Available OS: linux, qnx70. Default: linux"
- echo "# -c/--compiler - Compiler used for test. Available compilers are: intel1900, gnu540, gnu710 and so on"
- echo "# -a/--arch - Target architecture. Available architectures: intel64. Default: intel64"
- echo "# -i/--isa - ISA, Available ISAs: sse42, avx512. Default: sse42"
- echo "# -m/--mode - Test mode. Available modes: release, debug, relwithdebinfo, minsizerel. Default: release"
- echo "# -d/--domain - Domain to run. By default, all domains are selected for test"
- echo "# --test-case - Test case name. By default, all test cases are selected for run"
- echo "# --interface - Interface to test. Available interfaces: c, cpp. Default: both"
- echo "# -t/--test-type - Test type. Available types: correct_interface, incorrect_arguments, plausibility"
- echo "# --unit - Unit to test. By default, all domain units are selected for test"
- echo "#######################################"
- }
- ErrorMessage() {
- if [ $1 != 0 ]; then
- echo $2 - FAILED
- exit $1
- fi
- }
- while [[ $# -ge 1 ]]
- do
- key="$1"
- case $key in
- -d|--domain)
- DOMAIN="$2"
- shift
- ;;
- -a|--arch)
- LIB_ARCH="$2"
- shift
- ;;
- --test-case)
- TEST_CASE="$2"
- shift
- ;;
- -i|--isa)
- ISA="$2"
- shift
- ;;
- --interface)
- INTERFACE="$2"
- shift
- ;;
- -c|--compiler)
- COMPILER="$2"
- shift
- ;;
- -o|--os)
- OS="$2"
- shift
- ;;
- -m|--mode)
- MODE="$2"
- shift
- ;;
- -t|--test-type)
- TEST_TYPE="$2"
- shift
- ;;
- --unit)
- UNIT="$2"
- shift
- ;;
- *)
- ;;
- esac
- shift
- done
- if [ "${OS}" == "" ]; then
- OS="linux"
- fi
- if [ "${ARCH}" == "" ]; then
- ARCH="intel64"
- fi
- if [ "${MODE}" == "" ]; then
- MODE="release"
- fi
- if [ "${COMPILER}" == "" ]; then
- ErrorMessage 1 "You have to set compiler"
- fi
- if [ "${INTERFACE}" == "" ]; then
- INTERFACE="*"
- fi
- if [ "${TEST_TYPE}" == "" ]; then
- TEST_TYPE="*"
- fi
- if [ "${DOMAIN}" == "" ]; then
- DOMAIN="*"
- fi
- if [ "${UNIT}" == "" ]; then
- UNIT="*"
- fi
- if [ "$TEST_CASE" == "" ]; then
- TEST_CASE="*"
- fi
- if [ "${ISA}" == "" ]; then
- ISA="sse42"
- fi
- echo "#######################################"
- echo "# Starting ADL TS"
- echo "# Test configuration:"
- echo "# COMPILER: ${COMPILER}"
- echo "# OS: ${OS}"
- echo "# LIB_ARCH: ${ARCH}"
- echo "# MODE: ${MODE}"
- echo "# ISA: ${ISA}"
- echo "# DOMAIN: ${DOMAIN}"
- echo "# TEST CASE: ${TEST_CASE}"
- echo "# TEST TYPE: ${TEST_TYPE}"
- echo "# UNIT: ${UNIT}"
- echo "# INTERFACE: ${INTERFACE}"
- echo "# Start time: `date`"
- echo "########################################"
- # Структура папок, где находятся тесты:
- #
- # _build/adl_ts_<os>_<arch>_<compiler>_<mode>/<arch>/<isa>/<interface>_interface/<domain>/<unit>/unit_testing/<test-type>/<test-case>
- #
- # Где:
- # os - Target OS. Available OS: linux, qnx70
- # arch - Target architecture. Available architectures: intel64
- # compiler - Compiler used for build. Available compilers are: intel1900, gnu540, gnu710 and so on
- # mode - Build mode. Available modes: release, debug
- # isa - ISA, Available ISAs: sse42, avx512
- # interface - Interface to build. Available interfaces: c, cpp
- # domain - Domain to build
- # unit - Unit to build
- # test-type - Test type. Available types: correct_interface, incorrect_arguments, plausibility
- # test-case - Test case name
- for FILENAME in `find ./_build/adl_ts_${OS}_${ARCH}_${COMPILER}_${MODE}/${ARCH}/${ISA}/${INTERFACE}_interface/${DOMAIN}/${UNIT}/unit_testing/${TEST_TYPE}/ -type f -name "${TEST_CASE}*.exe"`
- do
- ./${FILENAME}
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement