forked from Xiaoning1943/dropbox-sdk-java-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-bench
executable file
·36 lines (29 loc) · 856 Bytes
/
run-bench
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
#! /usr/bin/env bash
set -euo pipefail
mvn_target_dir="target"
# Locate the script file. Cross symlinks if necessary.
loc="$0"
while [ -h "$loc" ]; do
ls=`ls -ld "$loc"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
loc="$link" # Absolute link
else
loc="`dirname "$loc"`/$link" # Relative link
fi
done
die() {
for line in "$@"; do
echo 1>&2 "$line"
done
exit 1
}
base_dir=`dirname "$loc"`
build_dir="$base_dir/$mvn_target_dir"
classpath_file="$build_dir/test-classpath"
[ -f "$classpath_file" ] || die \
"Missing file \"$classpath_file\"." \
"Did you run \"mvn test-compile\" yet?"
classpath="$build_dir/classes:$build_dir/test-classes"
classpath="$classpath:$(cat "$classpath_file")"
exec java -cp "$classpath" com.dropbox.core.CaliperMainRelay "$@"