Skip to content

Instantly share code, notes, and snippets.

@darvin
Created May 31, 2018 21:49
Show Gist options
  • Save darvin/cb9dc19e8727d1f169e73d4ac740dddf to your computer and use it in GitHub Desktop.
Save darvin/cb9dc19e8727d1f169e73d4ac740dddf to your computer and use it in GitHub Desktop.
#!/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