test/runner now accepts list of tests, defaulting to all

master
Mike Gerwitz 2014-11-21 09:12:45 -05:00
parent db95ae12ff
commit 061d4b7e09
1 changed files with 19 additions and 1 deletions

View File

@ -14,8 +14,11 @@
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# FIXME: This guy needs some cleanup.
# # # #
declare -r oldwd="$( pwd )"
cd "$( dirname "$0" )" cd "$( dirname "$0" )"
outdir=xspec outdir=xspec
@ -26,6 +29,20 @@ htmlindex()
cat >> "$index" 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 # xspec's output dir
mkdir -p "$outdir" mkdir -p "$outdir"
rm -f "$index" rm -f "$index"
@ -40,6 +57,7 @@ htmlindex <<EOH
<ul> <ul>
EOH EOH
declare -i status=0 declare -i status=0
while read spec; do while read spec; do
echo "$spec" echo "$spec"
@ -51,7 +69,7 @@ while read spec; do
printf ' <li><a href="%s">%s</a></li>' "$result" "$spec" \ printf ' <li><a href="%s">%s</a></li>' "$result" "$spec" \
| htmlindex | htmlindex
done < <( find . -name '*.xspec' ) done < <( get-test-list "$@" )
htmlindex <<EOF htmlindex <<EOF
</ul> </ul>