benchmarks: factorize the `die()` function into `bench_common.sh`
authorJean Privat <jean@pryen.org>
Tue, 15 Sep 2015 20:02:47 +0000 (16:02 -0400)
committerJean Privat <jean@pryen.org>
Tue, 15 Sep 2015 23:55:52 +0000 (19:55 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

benchmarks/bench_common.sh
benchmarks/bench_engines.sh
benchmarks/bench_languages.sh
benchmarks/bench_nitdoc.sh
benchmarks/bench_nitunit.sh
benchmarks/markdown/bench_markdown.sh

index 4ea5ffe..207edd0 100644 (file)
@@ -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
+}
index 8e9353b..37b2fb9 100755 (executable)
@@ -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
index 0e0b59a..2a33170 100755 (executable)
@@ -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()
index 07613b2..4a1d2a7 100755 (executable)
@@ -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()
index 53eb38c..23279f1 100755 (executable)
@@ -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()
index 7893fa8..c22e0b5 100755 (executable)
@@ -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()