2 # vim: ts=4 sw=4 noet :
3 #==================================================================================
4 # Copyright (c) 2020 Nokia
5 # Copyright (c) 2020 AT&T Intellectual Property.
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #==================================================================================
21 # This is a wrappter to the unit test script which is needed because CMake test
22 # is unable to set environment variables before executing the test command.
23 # this script assumes that env variables are passed on the command line in x=y
24 # format. We will set all that are given; the only exception to this is that
25 # we will NOT override the BUILD_PATH variable which allows it to be set
26 # from the script that invokes 'make test'
28 # We assume that the CMBUILD variable has a good build directory (e.g. .build)
29 # but the user can be sure by hard setting BUILD_PATH which will NOT be
30 # changed. For example:
32 # BUILD_PATH=$PWD make test ARGS="-V"
34 while [[ $1 == *"="* ]]
37 CMBUILD) # should be cmake build dir
38 if [[ -z $BUILD_PATH ]] # still allow user to override
40 export BUILD_PATH=${1##*=}
45 export LD_LIBRARY_PATH=${1##*=}
49 export C_INCLUDE_PATH=${1##*=}
53 export LIBRARY_PATH=${1##*=}
60 bash ./unit_test.ksh -q