Created
May 31, 2018 21:49
-
-
Save darvin/cb9dc19e8727d1f169e73d4ac740dddf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -Ee | |
files=("$@") | |
if ((${#files[@]} == 0)); then | |
echo "files not found" | |
exit 3 | |
fi | |
echo "TAP version 13" | |
arraylength=${#files[@]} | |
for (( i=1; i<${arraylength}+1; i++ )); | |
do | |
file=${files[$i-1]} | |
echo "# Subtest:" $file | |
test -e ${file} || exit | |
broken=false | |
while read -r line | |
do | |
if [[ $line =~ ^not\ ok ]] | |
then broken=true | |
fi | |
echo " "${line} | |
done < ${file} | |
if $broken | |
then echo "not ok $i - $file" | |
else | |
echo "ok $1 - $file" | |
fi | |
done | |
echo "1..$arraylength" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment