Make it work on OS X. Allow analyze script to continue if it sees a skipped test due to missing language/compiler.
parent
67effc9c86
commit
8097843c80
|
@ -263,7 +263,7 @@ sub main {
|
||||||
while ($line = <STDIN>) {
|
while ($line = <STDIN>) {
|
||||||
chomp($line);
|
chomp($line);
|
||||||
|
|
||||||
if ($line =~ /^\s*#/) {
|
if ($line =~ /^(\s*#|SKIPPING)/) {
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
17
run.sh
17
run.sh
|
@ -8,6 +8,19 @@ MIN_NLINES="${MIN_NLINES:=10}" # it's a fatal error if we get less than this num
|
||||||
SRC_FILTER="${SRC_FILTER:=x}" # if provided, execute only the given test
|
SRC_FILTER="${SRC_FILTER:=x}" # if provided, execute only the given test
|
||||||
DRY_RUN="${DRY_RUN:=0}" # if enabled, do only the compilation phase
|
DRY_RUN="${DRY_RUN:=0}" # if enabled, do only the compilation phase
|
||||||
|
|
||||||
|
_OS=$(uname)
|
||||||
|
if [ "$_OS" = "Linux" ]; then
|
||||||
|
TIME_CMD=$(which time)
|
||||||
|
elif [ "$_OS" = "Darwin" ]; then
|
||||||
|
TIME_CMD=$(which gtime)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$TIME_CMD" = "" ]; then
|
||||||
|
echo "Unable to find the GNU time command."
|
||||||
|
echo "If you are on a non Linux OS such as Mac OS or *BSD you will need to install it separately."
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
export RUN_TIME
|
export RUN_TIME
|
||||||
|
|
||||||
echo "# Run time limited to $RUN_TIME wall-clock seconds"
|
echo "# Run time limited to $RUN_TIME wall-clock seconds"
|
||||||
|
@ -48,11 +61,11 @@ function run_benchmark() {
|
||||||
|
|
||||||
echo "# ... run $n"
|
echo "# ... run $n"
|
||||||
|
|
||||||
TIMES_FILE="$(mktemp --suffix .langs_perf)" || exit 1
|
TIMES_FILE=$(mktemp) || exit 1
|
||||||
|
|
||||||
OUT="$(
|
OUT="$(
|
||||||
{
|
{
|
||||||
/usr/bin/time -o "$TIMES_FILE" --format \
|
$TIME_CMD -o "$TIMES_FILE" --format \
|
||||||
'real_TIME:%esec user_CPU:%Usec sys_CPU:%Ssec max_RSS:%Mkb swaps:%W ctx_sw:%c+%w' \
|
'real_TIME:%esec user_CPU:%Usec sys_CPU:%Ssec max_RSS:%Mkb swaps:%W ctx_sw:%c+%w' \
|
||||||
$RUN_CMD
|
$RUN_CMD
|
||||||
} 2>&1
|
} 2>&1
|
||||||
|
|
Loading…
Reference in New Issue