...

Text file src/github.com/peterbourgon/ff/v3/hack/lint-parallel-tests.bash

Documentation: github.com/peterbourgon/ff/v3/hack

     1#!/usr/bin/env bash
     2
     3set -o pipefail
     4
     5function for_all_test_files { find . -name '*_test.go' ; }
     6function first_line_of_test { xargs -n1 awk '/^func Test/{getline; print FILENAME ":" NR-1 " " $0}' ; }
     7function not_parallel       { grep -v 't.Parallel()' ; }
     8
     9if for_all_test_files | first_line_of_test | not_parallel
    10then
    11	echo FAIL: not all tests call t.Parallel
    12	exit 1
    13fi
    14

View as plain text