From 8789a2d0b77177380f542b919477b15cc18e28a8 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 15 Sep 2015 16:02:47 -0400 Subject: [PATCH] benchmarks: factorize the `die()` function into `bench_common.sh` Signed-off-by: Jean Privat --- benchmarks/bench_common.sh | 6 ++++++ benchmarks/bench_engines.sh | 8 -------- benchmarks/bench_languages.sh | 8 -------- benchmarks/bench_nitdoc.sh | 8 -------- benchmarks/bench_nitunit.sh | 8 -------- benchmarks/markdown/bench_markdown.sh | 8 -------- 6 files changed, 6 insertions(+), 40 deletions(-) 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() -- 1.7.9.5