[Added a shell script to retry previously unsuccessful tests
tobias@goedderz.info**20140721140808
 Ignore-this: 2a9d1a43af2f371b58f8e90430e54ad5
] addfile ./run_failed_tests.bash
hunk ./run_failed_tests.bash 1
+#!/bin/bash
+
+tests_dir=tests/unsuccessful
+
+# memory limit per process.
+# passed to bash's ulimit -v, so specified in kibi.
+memlimit="$((1024*1024))"
+
+# in seconds
+timelimit=60
+
+log() {
+    echo "[$(date +"%F %X")]" "$@"
+}
+
+for batch_fn in "${tests_dir}"/*.bat
+do
+    output_fn="${tests_dir}/$(basename -s .bat "$batch_fn").out"
+    echo "[$(date +"%F %X")] Executing:" ulimit -v $memlimit\; timeout $timelimit ./igor2 -b "${batch_fn}" \> "$output_fn"
+    (   ulimit -v "$memlimit"
+        timeout "$timelimit" \
+        ./igor2 -b "$batch_fn" 2>&1 \
+            | grep -v '^File loaded in [0-9.]\+s$\|^\s*CPU: [0-9.]\+s$' \
+            > "$output_fn" )
+    if [ $? = 0 ]
+    then
+        log '!!!' Unexpected success: "$batch_fn" / "$output_fn"
+    else
+        log Expected failure: "$batch_fn"
+    fi
+done