From: Jean Privat Date: Tue, 15 Sep 2015 20:02:47 +0000 (-0400) Subject: benchmarks: factorize the `die()` function into `bench_common.sh` X-Git-Tag: v0.7.8~15^2~5 X-Git-Url: http://nitlanguage.org benchmarks: factorize the `die()` function into `bench_common.sh` Signed-off-by: Jean Privat --- diff --git a/benchmarks/bench_common.sh b/benchmarks/bench_common.sh index 4ea5ffe..207edd0 100644 --- a/benchmarks/bench_common.sh +++ b/benchmarks/bench_common.sh @@ -94,3 +94,9 @@ function skip_test() return 1 } +# Helper function. Print the error message and set $died to 1 +function die() +{ + echo >&2 "error: $*" + died=1 +} diff --git a/benchmarks/bench_engines.sh b/benchmarks/bench_engines.sh index 8e9353b..37b2fb9 100755 --- a/benchmarks/bench_engines.sh +++ b/benchmarks/bench_engines.sh @@ -26,14 +26,6 @@ source ./bench_plot.sh # Can be overrided with 'the option -n' count=2 -### HELPER FUNCTIONS ## - -function die() -{ - echo >&2 "error: $*" - died=1 -} - # HELPER FOR NIT # # Run standards benchs on a compiler command diff --git a/benchmarks/bench_languages.sh b/benchmarks/bench_languages.sh index 0e0b59a..2a33170 100755 --- a/benchmarks/bench_languages.sh +++ b/benchmarks/bench_languages.sh @@ -26,14 +26,6 @@ source ./bench_plot.sh # Can be overrided with 'the option -n' count=2 -### HELPER FUNCTIONS ## - -function die() -{ - echo >&2 "error: $*" - died=1 -} - ## HANDLE OPTIONS ## function usage() diff --git a/benchmarks/bench_nitdoc.sh b/benchmarks/bench_nitdoc.sh index 07613b2..4a1d2a7 100755 --- a/benchmarks/bench_nitdoc.sh +++ b/benchmarks/bench_nitdoc.sh @@ -24,14 +24,6 @@ source ./bench_plot.sh # Can be overrided with 'the option -n' count=3 -### HELPER FUNCTIONS ## - -function die() -{ - echo >&2 "error: $*" - died=1 -} - ## HANDLE OPTIONS ## function usage() diff --git a/benchmarks/bench_nitunit.sh b/benchmarks/bench_nitunit.sh index 53eb38c..23279f1 100755 --- a/benchmarks/bench_nitunit.sh +++ b/benchmarks/bench_nitunit.sh @@ -24,14 +24,6 @@ source ./bench_plot.sh # Can be overrided with 'the option -n' count=3 -### HELPER FUNCTIONS ## - -function die() -{ - echo >&2 "error: $*" - died=1 -} - ## HANDLE OPTIONS ## function usage() diff --git a/benchmarks/markdown/bench_markdown.sh b/benchmarks/markdown/bench_markdown.sh index 7893fa8..c22e0b5 100755 --- a/benchmarks/markdown/bench_markdown.sh +++ b/benchmarks/markdown/bench_markdown.sh @@ -27,14 +27,6 @@ count=2 # Default number of times the input file is transformed during a single run s=200 -### HELPER FUNCTIONS ## - -function die() -{ - echo >&2 "error: $*" - died=1 -} - ## HANDLE OPTIONS ## function usage()