Modification of *-time tests so that they don't break if the test was skipped.
authorMartin Hořeňovský <Martin.Horenovsky@gmail.com>
Mon, 26 Aug 2013 10:06:42 +0000 (12:06 +0200)
committerMartin Hořeňovský <Martin.Horenovsky@gmail.com>
Mon, 26 Aug 2013 10:06:42 +0000 (12:06 +0200)
Now it checks and attempts to create symbolic links only if the directory it works from isn't empty.
(When it is, calling "ln -s ../somedir/*.txt ." creates broken link named *.txt and plot.sh,
 so the plotting script attempts to create a plot, which fails and stops the rest of the plotting from happening.)

gw-tests/filter-time.sh
gw-tests/nop-highprio-time.sh
gw-tests/nop-time.sh
gw-tests/user-time.sh

index c23a3b0..ed500ac 100755 (executable)
@@ -5,7 +5,13 @@
 NO_GW_NEEDED=true
 
 main() {
-       ln -s ../filter/*.txt .
+    #Check that the test wasn't skipped.
+    if [ "$(ls -A ../filter)" ]; then
+        #Otherwise this would create *.txt file and plot.sh and break the automation
+        ln -s ../filter/*.txt .
+    else
+        SKIPPED=1; return;
+    fi;
 }
 
 ids="0 $(seq 255 256 2047)"
index 22065c3..8faeeee 100755 (executable)
@@ -3,7 +3,13 @@
 . lib.sh
 
 main() {
-       ln -s ../nop-highprio/*.txt .
+    #Check that the test wasn't skipped.
+    if [ "$(ls -A ../nop-highprio)" ]; then
+        #Otherwise this would create *.txt file and plot.sh and break the automation
+        ln -s ../nop-highprio/*.txt .
+    else
+        SKIPPED=1; return;
+    fi;
 }
 
 plot_cmds() {
index 585d733..dea1483 100755 (executable)
@@ -3,7 +3,13 @@
 . lib.sh
 
 main() {
-       ln -s ../nop/*.txt .
+    #Check that the test wasn't skipped.
+    if [ "$(ls -A ../nop)" ]; then
+        #Otherwise this would create *.txt file and plot.sh and break the automation
+        ln -s ../nop/*.txt .
+    else
+        SKIPPED=1; return;
+    fi;
 }
 
 ADDITIONAL_PLOTS=detail
index d7e095a..c68408b 100755 (executable)
@@ -5,7 +5,13 @@
 NO_GW_NEEDED=true
 
 main() {
-       ln -s ../user/*.txt .
+    #Check that the test wasn't skipped.
+    if [ "$(ls -A ../user)" ]; then
+        #Otherwise this would create *.txt file and plot.sh and break the automation
+        ln -s ../user/*.txt .
+    else
+        SKIPPED=1; return;
+    fi;
 }
 
 #ADDITIONAL_PLOTS=detail