feat: support run testcases in specified folder path, including testcases in sub-folders

This commit is contained in:
debugtalk
2022-03-28 23:58:35 +08:00
parent f93e5eb789
commit 71a2ae944d
4 changed files with 41 additions and 29 deletions
+11 -1
View File
@@ -296,13 +296,23 @@ func TestLoadTestCases(t *testing.T) {
t.Fail()
}
// load test cases from folder path, including sub folders
tc = TestCasePath("../examples/demo-with-py-plugin/")
testCases, err = loadTestCases(&tc)
if !assert.Nil(t, err) {
t.Fail()
}
if !assert.Equal(t, len(testCases), 3) {
t.Fail()
}
// load test cases from single file path
tc = demoTestCaseWithPluginJSONPath
testCases, err = loadTestCases(&tc)
if !assert.Nil(t, err) {
t.Fail()
}
if !assert.Equal(t, len(testCases), 1) {
if !assert.Equal(t, 1, len(testCases)) {
t.Fail()
}