-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from dl1998/add-coveralls-support
Add support for the Coveralls
- Loading branch information
Showing
4 changed files
with
45 additions
and
50 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
# Usage: ./exclude_from_tests.sh [-v] file [paths...] | ||
# -v: verbose mode | ||
|
||
verbose=0 | ||
if [ "$1" == "-v" ]; then | ||
verbose=1 | ||
shift | ||
fi | ||
|
||
file=$1 | ||
shift | ||
|
||
tmpfile=$(mktemp) | ||
|
||
while read -r line; do | ||
exclude=0 | ||
for path in "$@"; do | ||
if [[ $line == *"$path"* ]]; then | ||
exclude=1 | ||
[ $verbose -eq 1 ] && echo "Excluding: $line" | ||
break | ||
fi | ||
done | ||
if [ $exclude -eq 0 ]; then | ||
echo "$line" >> "$tmpfile" | ||
fi | ||
done < "$file" | ||
|
||
mv "$tmpfile" "$file" | ||
|
||
echo "Excluded paths from the file." |