mirror of https://github.com/daffainfo/nuclei.git
updates to execute func in integration-test.go
parent
2456121e1a
commit
909aa4cd79
|
@ -62,7 +62,7 @@ func runTests(customTemplatePaths map[string]struct{}) map[string]struct{} {
|
|||
|
||||
for templatePath, testCase := range testCases {
|
||||
if len(customTemplatePaths) == 0 || contains(customTemplatePaths, templatePath) {
|
||||
if err, failedTemplatePath := execute(testCase, templatePath); err != nil {
|
||||
if failedTemplatePath, err := execute(testCase, templatePath); err != nil {
|
||||
failedTestTemplatePaths[failedTemplatePath] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
@ -72,14 +72,14 @@ func runTests(customTemplatePaths map[string]struct{}) map[string]struct{} {
|
|||
return failedTestTemplatePaths
|
||||
}
|
||||
|
||||
func execute(testCase testutils.TestCase, templatePath string) (error, string) {
|
||||
func execute(testCase testutils.TestCase, templatePath string) (string, error) {
|
||||
if err := testCase.Execute(templatePath); err != nil {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "%s Test \"%s\" failed: %s\n", failed, templatePath, err)
|
||||
return err, templatePath
|
||||
return templatePath, err
|
||||
}
|
||||
|
||||
fmt.Printf("%s Test \"%s\" passed!\n", success, templatePath)
|
||||
return nil, ""
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func expectResultsCount(results []string, expectedNumber int) error {
|
||||
|
|
Loading…
Reference in New Issue