From a56e0285359040b3024c373bb6f702556e1a6d60 Mon Sep 17 00:00:00 2001 From: Jeff Bilyk Date: Sat, 11 Dec 2010 16:22:28 +0000 Subject: apts: added generic-apk test for apks without a test file Added generic-apk test file, which just apk_add's and apk_del's package for the cases where no test file exists --- apts | 6 ++++-- tests/generic-apk | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 tests/generic-apk diff --git a/apts b/apts index 56294f8..247dfd7 100755 --- a/apts +++ b/apts @@ -6,6 +6,7 @@ # Author: Jeff Bilyk # Version History: # Dec 4 2010 - Initial version +# Dec 11 2010 - Added generic-apk test for cases where there isn't a package test file # Get file to output to program=$0 @@ -51,10 +52,11 @@ while [ $# -gt 0 ]; do PACKAGE=$1 # does testing file exist test -e ./tests/$PACKAGE + # If no testing file exists then run generic-apk if [ "$?" == "1" ]; - then echo "Testing file for $PACKAGE does not exist"; + then echo "Testing file for $PACKAGE does not exist" && /bin/sh -e ./tests/generic-apk >> "$OUTFILE" 2>&1 && echo "$PACKAGE passed tests" && exit 0; # if testing file exists, then keep running - else echo "Testing $PACKAGE apk" && /bin/sh -e ./tests/$PACKAGE >> "$OUTFILE" 2>&1 && echo "$PACKAGE passed tests" && exit 0;i + else echo "Testing $PACKAGE apk" && /bin/sh -e ./tests/$PACKAGE >> "$OUTFILE" 2>&1 && echo "$PACKAGE passed tests" && exit 0; fi i=$(( $i + 1 )) shift diff --git a/tests/generic-apk b/tests/generic-apk new file mode 100644 index 0000000..e14d631 --- /dev/null +++ b/tests/generic-apk @@ -0,0 +1,2 @@ + apk_add $@ + apk_del $@ -- cgit v1.2.3