From: Jean Privat Date: Fri, 26 Jul 2013 16:36:50 +0000 (-0400) Subject: bench: enable HTML generation X-Git-Tag: v0.6~4^2 X-Git-Url: http://nitlanguage.org bench: enable HTML generation Signed-off-by: Jean Privat --- diff --git a/benchmarks/bench_engines.sh b/benchmarks/bench_engines.sh index 5e8716b..df4bba2 100755 --- a/benchmarks/bench_engines.sh +++ b/benchmarks/bench_engines.sh @@ -96,6 +96,9 @@ function skip_test() else return 0 fi + if test -n "$html"; then + echo >>"$html" "

$1

" + fi echo "*" echo "* $1 *****" echo "*" @@ -146,6 +149,7 @@ function usage() echo " -n count: number of execution for each bar (default: $count)" echo " --dry: Do not run the commands, just reuse the data and generate the graph" echo " --fast: Run less and faster tests" + echo " --html: Generate and HTML output" echo " -h: this help" } @@ -157,6 +161,7 @@ while [ "$stop" = false ]; do -n) count="$2"; shift; shift;; --dry) dry_run=true; shift;; --fast) fast=true; shift;; + --html) html="index.html"; echo >"$html" ""; shift;; *) stop=true esac done @@ -444,6 +449,10 @@ function bench_compilation_time } bench_compilation_time +if test -n "$html"; then + echo >>"$html" "" +fi + if test -n "$died"; then echo "Some commands failed" exit 1 diff --git a/benchmarks/bench_plot.sh b/benchmarks/bench_plot.sh index 405aa7e..e874308 100755 --- a/benchmarks/bench_plot.sh +++ b/benchmarks/bench_plot.sh @@ -62,6 +62,9 @@ function prepare_res() { echo echo "# [$2] $3 #" + if test -n "$html"; then + echo >>"$html" "

[$2] $3 data

" + fi res=$1 if [ "$plots" = "" ]; then plots="plot '$1' using 4:2:3:xticlabels(5) ti '$2'" @@ -91,9 +94,19 @@ set title "$1 ; avg. on $count-1 runs" set ylabel "time (s)" $plots END +plots= + +if test -n "$html"; then + echo "# gnuplot $1" + bn=`basename "$1" .gnu` + gnuplot -e "set term png; set output \"$bn.png\"" "$1" + echo gnuplot -e "set term png; set output \"$bn.png\"" "$1" + + echo >>"$html" "" +else echo "# gnuplot -p $1" gnuplot -p "$1" - plots= +fi } ## GLOBAL VARIABLES ## @@ -104,3 +117,5 @@ res= # The current stuff to plot (set by prepare_res, used by plot) plots= +# The name of the html file if output is set to html +html=