lib: Add echo_plot() to make plotting of multiple graphs easier
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 11:55:27 +0000 (12:55 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 1 Dec 2010 11:55:27 +0000 (12:55 +0100)
gw-tests/gw-filter.sh
gw-tests/lib.sh

index bebdc3f..757f328 100755 (executable)
@@ -22,11 +22,9 @@ plot [0:1500] [1:$COUNT] \\
 EOF
     lt=1
     for i in $ids; do
-       (( i != 0)) && echo ", \\"
-       echo -n "    " \"hist-$i.dat\" with lp lt $lt title \"Message id $i\"
+       echo_plot "\"hist-$i.dat\" with lp lt $lt title \"Message id $i\""
         lt=$((lt+1))
     done
-    echo
 }
     
 test_end
index 439ddc7..cacde47 100644 (file)
@@ -65,6 +65,13 @@ create_dirs_and_links() {
     echo $d
 }
 
+echo_plot() {
+    plot=$1
+    [[ "$_plot_separator" ]] && echo ", \\"
+    _plot_separator=t
+    echo -n "    " $plot
+}
+
 _run() {
     if [[ ! "$OPT_PLOT_ONLY" ]]; then
        kernel_versions=$(sshgw uname -r)