Skip to content
Browse files

Add batch.sh file for hello benchmark, and add generation of expected…

… output for it to init.sh
  • Loading branch information...
1 parent 8c050dc commit f066fcf68278a999380663b2341ca6506423985e @jafingerhut committed Oct 21, 2012
Showing with 110 additions and 3 deletions.
  1. +107 −0 hello/batch.sh
  2. +0 −1 hello/output/none-expected-output.txt
  3. +1 −0 init.sh
  4. +2 −2 run-all.sh
View
107 hello/batch.sh
@@ -0,0 +1,107 @@
+#! /bin/bash
+
+source ../env.sh
+
+OUTPUT_DIR=./output
+mkdir -p $OUTPUT_DIR
+
+BENCHMARK="hello"
+
+#ALL_LANGUAGES="java jruby scala ${ALL_CLOJURE_VERSIONS}"
+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) LANGUAGES="$LANGUAGES $1"
+ ;;
+ # There is really only quick here, but may as well use all
+ # keywords so that I can be able to run this test using
+ # "./run-all.sh long" from the directory above.
+ 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)
+ ;;
+ medium)
+ ;;
+ long)
+ ;;
+ 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 hello.perl"
+ ;;
+ ghc) CMD=./ghc-run.sh
+ ( ./ghc-compile.sh ) >& ${OUTPUT_DIR}/ghc-compile-log.txt
+ ;;
+ jruby) CMD="$JRUBY --server hello.jruby"
+ ;;
+ esac
+ case $L in
+ sbcl) EXTRA_LANG_ARGS="1"
+ ;;
+ 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} ${EXTRA_LANG_ARGS} ) 2>&1 | tee ${CONSOLE}"
+ ( ${CMD} ${OUT} ${N} ${EXTRA_LANG_ARGS} ) 2>&1 | tee ${CONSOLE}
+ ;;
+ *)
+ echo "( time ${CMD} ${N} ${EXTRA_LANG_ARGS} > ${OUT} ) 2>&1 | tee ${CONSOLE}"
+ ( time ${CMD} ${N} ${EXTRA_LANG_ARGS} > ${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
View
1 hello/output/none-expected-output.txt
@@ -1 +0,0 @@
-Hello, world!
View
1 init.sh
@@ -115,6 +115,7 @@ fi
make_expected_output_files binarytrees quick medium long
make_expected_output_files fannkuch quick medium long
make_expected_output_files fannkuchredux quick medium long
+make_expected_output_files hello long
make_expected_output_files mandelbrot quick medium long
make_expected_output_files nbody quick medium long
make_expected_output_files pidigits quick medium long
View
4 run-all.sh
@@ -13,9 +13,9 @@
# chameneosredux and threadring have not yet been implemented in
# Clojure.
-#for j in binarytrees fannkuch fannkuchredux fasta knucleotide mandelbrot meteor nbody pidigits regexdna revcomp spectralnorm
+#for j in binarytrees fannkuch fannkuchredux fasta hello knucleotide mandelbrot meteor nbody pidigits regexdna revcomp spectralnorm
-for j in binarytrees fannkuchredux fasta knucleotide mandelbrot nbody pidigits regexdna revcomp spectralnorm
+for j in binarytrees fannkuchredux fasta hello knucleotide mandelbrot nbody pidigits regexdna revcomp spectralnorm
do
cd $j
./batch.sh "$@"

0 comments on commit f066fcf

Please sign in to comment.
Something went wrong with that request. Please try again.