| 1 |
#!/bin/bash |
| 2 |
# |
| 3 |
# Licensed to the Apache Software Foundation (ASF) under one |
| 4 |
# or more contributor license agreements. See the NOTICE file |
| 5 |
# distributed with this work for additional information |
| 6 |
# regarding copyright ownership. The ASF licenses this file |
| 7 |
# to you under the Apache License, Version 2.0 (the |
| 8 |
# "License"); you may not use this file except in compliance |
| 9 |
# with the License. You may obtain a copy of the License at |
| 10 |
# |
| 11 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
# |
| 13 |
# Unless required by applicable law or agreed to in writing, |
| 14 |
# software distributed under the License is distributed on an |
| 15 |
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 |
# KIND, either express or implied. See the License for the |
| 17 |
# specific language governing permissions and limitations |
| 18 |
# under the License. |
| 19 |
# |
| 20 |
|
| 21 |
merge_paths() { |
| 22 |
# Merge paths, remove duplicates (keep first instance) |
| 23 |
path=$(echo $* | sed 's/:/ /'g) # Split with spaces. |
| 24 |
newpath="" |
| 25 |
for d in $path; do # Remove duplicates |
| 26 |
{ echo $newpath | grep -q "\(:\|^\)$d\(:\|$\)"; } || newpath="$newpath:$d" |
| 27 |
done |
| 28 |
echo $newpath | sed 's/^://' # Remove leading : |
| 29 |
} |
| 30 |
|
| 31 |
PROTON_HOME=@CMAKE_SOURCE_DIR@ |
| 32 |
PROTON_BUILD=@CMAKE_BINARY_DIR@ |
| 33 |
|
| 34 |
PYTHON_BINDING=$PROTON_BUILD/python |
| 35 |
|
| 36 |
# Python |
| 37 |
COMMON_PYPATH=$PROTON_HOME/python/tests:$PROTON_HOME/python:$PROTON_HOME/tools/python |
| 38 |
export PYTHONPATH=$COMMON_PYPATH:$PYTHON_BINDING |
| 39 |
|
| 40 |
# Ruby |
| 41 |
RUBY_BINDING=$PROTON_BUILD/ruby |
| 42 |
RUBY_SRC=$PROTON_HOME/ruby |
| 43 |
export RUBYLIB=$RUBY_BINDING:$RUBY_SRC/lib:$RUBY_SRC/tests:$RUBY_SRC/spec |
| 44 |
|
| 45 |
# Go |
| 46 |
export GOPATH="$PROTON_BUILD/go" |
| 47 |
# Help Go compiler find libraries and include files. |
| 48 |
export C_INCLUDE_PATH="$(merge_paths $PROTON_HOME/include $PROTON_BUILD/include $C_INCLUDE_PATH)" |
| 49 |
export LIBRARY_PATH="$(merge_paths $PROTON_BUILD $LIBRARY_PATH)" |
| 50 |
export LD_LIBRARY_PATH="$(merge_paths $PROTON_BUILD $LD_LIBRARY_PATH)" |
| 51 |
|
| 52 |
# Test applications |
| 53 |
export PATH="$(merge_paths $PATH $PROTON_BUILD/c/tools $PROTON_HOME/python/tests)" |
| 54 |
|
| 55 |
# Can the test harness use saslpasswd2? |
| 56 |
if [[ -x "$(type -p saslpasswd2)" ]] ; then |
| 57 |
export SASLPASSWD=$(type -p saslpasswd2) |
| 58 |
fi |
| 59 |
|
| 60 |
# Location of interop test files. |
| 61 |
export PN_INTEROP_DIR=$PROTON_HOME/tests/interop |