mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-23 10:35:23 +00:00
updates to execute func in integration-test.go
This commit is contained in:
parent
2456121e1a
commit
909aa4cd79
@ -62,7 +62,7 @@ func runTests(customTemplatePaths map[string]struct{}) map[string]struct{} {
|
|||||||
|
|
||||||
for templatePath, testCase := range testCases {
|
for templatePath, testCase := range testCases {
|
||||||
if len(customTemplatePaths) == 0 || contains(customTemplatePaths, templatePath) {
|
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{}{}
|
failedTestTemplatePaths[failedTemplatePath] = struct{}{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,14 +72,14 @@ func runTests(customTemplatePaths map[string]struct{}) map[string]struct{} {
|
|||||||
return failedTestTemplatePaths
|
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 {
|
if err := testCase.Execute(templatePath); err != nil {
|
||||||
_, _ = fmt.Fprintf(os.Stderr, "%s Test \"%s\" failed: %s\n", failed, templatePath, err)
|
_, _ = 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)
|
fmt.Printf("%s Test \"%s\" passed!\n", success, templatePath)
|
||||||
return nil, ""
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func expectResultsCount(results []string, expectedNumber int) error {
|
func expectResultsCount(results []string, expectedNumber int) error {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user