forked from RafaelOstertag/arrayperformance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·57 lines (46 loc) · 986 Bytes
/
build.sh
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
53
54
55
56
57
#!/bin/bash
set -eu
TEST_DIRECTORIES="java cpp go python"
function err() {
echo "$@" 1>&2
}
function commandNotFound() {
local command="$1"
err "$command not found in \$PATH=$PATH"
}
function testCommandPresence() {
local command="$1"
which "$command" >/dev/null 2>&1
}
function commandPresentOrDie() {
local command="$1"
if ! testCommandPresence "${command}"
then
err "${command} not found in \$PATH=$PATH"
exit 1
fi
echo "${command} found"
}
function preflight() {
commandPresentOrDie java
commandPresentOrDie go
commandPresentOrDie clang++
commandPresentOrDie python3.7
export GO=go
export GOROOT=$(goRoot `which go`)
export CXX=clang++
export PYTHON=python3.7
}
function goRoot() {
local goBin="$1"
dirname `dirname "${goBin}"`
}
preflight
for d in ${TEST_DIRECTORIES}
do
pushd $d >/dev/null
echo ""
echo "*** Build $d ***"
./build.sh
popd >/dev/null
done