Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0b078bfa2c
Fetching contributors…

Cannot retrieve contributors at this time

executable file 109 lines (95 sloc) 2.379 kb
#! /bin/bash
source ../env.sh
OUTPUT_DIR=./output
mkdir -p $OUTPUT_DIR
BENCHMARK="spectralnorm"
# The compiled GHC executable crashes on my Mac. Leaving it out of
# the default list of languages for now.
#ALL_LANGUAGES="sbcl perl ghc java clj-1.2 clj-1.3-alpha1 clj-1.3-alpha3 clj-1.3-alpha4 jruby scala"
#ALL_LANGUAGES="java clj-1.2 jruby scala"
ALL_LANGUAGES="java ${ALL_CLOJURE_VERSIONS}"
ALL_TESTS="quick medium long"
LANGUAGES=""
TESTS=""
while [ $# -ge 1 ]
do
case $1 in
sbcl|perl|ghc|java|jruby|scala) LANGUAGES="$LANGUAGES $1"
;;
quick|medium|long) TESTS="$TESTS $1"
;;
*)
check_clojure_version_spec $1
if [ $? != 0 ]
then
1>&2 echo "Unrecognized command line parameter: $1"
exit 1
fi
LANGUAGES="$LANGUAGES clj-${CLJ_VERSION_STR}"
;;
esac
shift
done
#echo "LANGUAGES=$LANGUAGES"
#echo "TESTS=$TESTS"
if [ "x$LANGUAGES" = "x" ]
then
LANGUAGES=${ALL_LANGUAGES}
fi
if [ "x$TESTS" = "x" ]
then
TESTS=${ALL_TESTS}
fi
echo "LANGUAGES=$LANGUAGES"
echo "TESTS=$TESTS"
for T in $TESTS
do
case $T in
quick) N=1000
;;
medium) N=2000
;;
long) N=5500
;;
esac
for L in $LANGUAGES
do
case $L in
clj*) CMD="./clj-run.sh $L"
( ./clj-compile.sh $L ) >& ${OUTPUT_DIR}/clj-compile-log.txt
;;
java) CMD=./java-run.sh
( ./java-compile.sh ) >& ${OUTPUT_DIR}/java-compile-log.txt
;;
sbcl) CMD=./sbcl-run.sh
( ./sbcl-compile.sh ) >& ${OUTPUT_DIR}/sbcl-compile-log.txt
;;
perl) CMD="$PERL spectralnorm.perl"
;;
ghc) CMD=./ghc-run.sh
( ./ghc-compile.sh ) >& ${OUTPUT_DIR}/ghc-compile-log.txt
;;
jruby)
CMD="${JRUBY} --server spectralnorm.jruby"
;;
scala) CMD=./scala-run.sh
( ./scala-compile.sh ) >& ${OUTPUT_DIR}/scala-compile-log.txt
;;
esac
echo
echo "benchmark: $BENCHMARK language: $L test: $T"
OUT=${OUTPUT_DIR}/${T}-${L}-output.txt
CONSOLE=${OUTPUT_DIR}/${T}-${L}-console.txt
case $L in
clj*|java)
echo "( ${CMD} ${OUT} ${N} ) 2>&1 | tee ${CONSOLE}"
( ${CMD} ${OUT} ${N} ) 2>&1 | tee ${CONSOLE}
;;
*)
echo "( time ${CMD} ${N} > ${OUT} ) 2>&1 | tee ${CONSOLE}"
( time ${CMD} ${N} > ${OUT} ) 2>&1 | tee ${CONSOLE}
;;
esac
cmp_and_rm_2nd_if_correct ${OUTPUT_DIR}/${T}-expected-output.txt ${OUT} 2>&1 | tee -a ${CONSOLE}
done
done
Jump to Line
Something went wrong with that request. Please try again.