From 061d4b7e095c1006d127414f80c9bd9c2c32f2c4 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 21 Nov 2014 09:12:45 -0500 Subject: [PATCH] test/runner now accepts list of tests, defaulting to all --- test/runner | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/test/runner b/test/runner index 53f1bd2..07bc80f 100755 --- a/test/runner +++ b/test/runner @@ -14,8 +14,11 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# +# FIXME: This guy needs some cleanup. # # +declare -r oldwd="$( pwd )" cd "$( dirname "$0" )" outdir=xspec @@ -26,6 +29,20 @@ htmlindex() cat >> "$index" } +get-test-list() +{ + if [ $# -eq 0 ]; then + find . -name '*.xspec' + else + ( + cd "$oldwd" \ + && for spec in "$@"; do + echo "$( readlink -f "$spec" )" + done + ) + fi +} + # xspec's output dir mkdir -p "$outdir" rm -f "$index" @@ -40,6 +57,7 @@ htmlindex < EOH + declare -i status=0 while read spec; do echo "$spec" @@ -51,7 +69,7 @@ while read spec; do printf '
  • %s
  • ' "$result" "$spec" \ | htmlindex -done < <( find . -name '*.xspec' ) +done < <( get-test-list "$@" ) htmlindex <