Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
package auth

import (
"testing"

. "github.com/pingcap/check"
)

Expand All @@ -22,6 +24,10 @@ var _ = Suite(&testAuthSuite{})
type testAuthSuite struct {
}

func TestT(t *testing.T) {
TestingT(t)
}

func (s *testAuthSuite) TestEncodePassword(c *C) {
pwd := "123"
c.Assert(EncodePassword(pwd), Equals, "*23AE809DDACAF96AF0FD78ED04B6A265E05AA257")
Expand Down
13 changes: 13 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
#!/bin/sh

# If 'check.TestingT' is not used in any of the *_test.go files in a subdir no tests will run.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Let's run this check in the make test of Makefile.


for f in $(git grep -l 'github.com/pingcap/check' | grep '/' | cut -d/ -f1 | uniq)
do
if ! grep -r TestingT "$f" > /dev/null
then
echo "check.TestingT missing from $f"
exit 1
fi
done

GO111MODULE=on go test -p 1 -race -covermode=atomic -coverprofile=coverage.txt -coverpkg=./... ./...