MCPcopy
hub / github.com/sqlc-dev/sqlc / FindTests

Function FindTests

internal/endtoend/case_test.go:73–96  ·  view source on GitHub ↗
(t *testing.T, root, testctx string)

Source from the content-addressed store, hash-verified

71}
72
73func FindTests(t *testing.T, root, testctx string) []*Testcase {
74 var tcs []*Testcase
75 err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
76 if err != nil {
77 return err
78 }
79 if info.Name() == "sqlc.json" || info.Name() == "sqlc.yaml" || info.Name() == "sqlc.yml" {
80 dir := filepath.Dir(path)
81 tcs = append(tcs, &Testcase{
82 Path: dir,
83 Name: strings.TrimPrefix(dir, root+string(filepath.Separator)),
84 ConfigName: info.Name(),
85 Stderr: parseStderr(t, dir, testctx),
86 Exec: parseExec(t, dir),
87 })
88 return filepath.SkipDir
89 }
90 return nil
91 })
92 if err != nil {
93 t.Fatal(err)
94 }
95 return tcs
96}

Callers 3

TestFormatFunction · 0.85
TestValidSchemaFunction · 0.85
TestReplayFunction · 0.85

Calls 3

parseStderrFunction · 0.85
parseExecFunction · 0.85
NameMethod · 0.65

Tested by

no test coverage detected