如何使用银杏写多个测试文件中的测试用例?

How to write test case in multiple test file using ginkgo?

a_suite_test.go file:

func TestA(t *testing.T) {
    RegisterFailHandler(Fail)
    RunSpecs(t, "A Suite")
}

a_test.go:

var _ = Describe("A", func() {
    Context("A", func() {
        It("A", func() {
            Expect(1).To(Equal(1))
        })
    })
})

I run ginkgo, but error is throwed:

Failed to compile A:

go build xxx: no non-test Go files in xxx

Can I write test case in other test files rather than writing in suite test file ?

run

go test ./...

from root of your project, it will run all your tests. With ginkgo you need this suite file, but go test command will grab it and run it.