-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathtest_init
More file actions
52 lines (35 loc) · 732 Bytes
/
test_init
File metadata and controls
52 lines (35 loc) · 732 Bytes
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
#! /usr/bin/env bash
# Source this file for setting up test preqrequisites
is_sourced() {
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]
then
return 0
fi
return 1
}
is_darwin() {
if [[ "$(uname -s)" = "Darwin"* ]]
then
return 0
fi
return 1
}
main() {
local temp_file
local shm_dylib_dir
if ! is_sourced ; then
echo "usage: source ${BASH_SOURCE##*/}" 1>&2
return 1
fi
shm_dylib_dir="$(cd ../src/; echo ${PWD})"
if is_darwin; then
export DYLD_FALLBACK_LIBRARY_PATH="${shm_dylib_dir}:${DYLD_FALLBACK_LIBRARY_PATH}"
else
export LD_LIBRARY_PATH="${shm_dylib_dir}:${LD_LIBRARY_PATH}"
fi
temp_file="$(mktemp "shm_file_XXXXX")"
rm "${temp_file}"
export SHM_FILE="${temp_file}"
return 0
}
main "$@"