-
-
Save peterbourgon/4288a092ce0f962f5b14e2457085a815 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
function for_all_test_files { find ./{cmd,pkg} -name '*_test.go' ; } | |
function first_line_of_test { xargs -n1 awk '/^func Test/{getline; print FILENAME ":" NR-1 " " $0}' ; } | |
function not_parallel { grep -v 't.Parallel()' ; } | |
if for_all_test_files | first_line_of_test | not_parallel | |
then | |
echo FAIL: not all tests call t.Parallel | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment