2023-02-15 16:53:28 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"path"
|
2023-02-17 17:57:05 +00:00
|
|
|
|
|
|
|
"github.com/ledgerwatch/log/v3"
|
2023-02-15 16:53:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func executeTest(p string) (bool, error) {
|
2023-02-17 17:57:05 +00:00
|
|
|
log.Root().SetHandler(log.LvlFilterHandler(log.LvlCrit, log.StderrHandler))
|
2023-02-15 16:53:28 +00:00
|
|
|
initialPath, err := os.Getwd()
|
|
|
|
if err != nil {
|
|
|
|
return false, err
|
|
|
|
}
|
|
|
|
var implemented bool
|
|
|
|
var fn testFunc
|
|
|
|
os.Chdir(p)
|
|
|
|
if fn, implemented = TestCollection[path.Join(testName, caseName)]; implemented {
|
|
|
|
err = fn()
|
|
|
|
}
|
|
|
|
os.Chdir(initialPath)
|
2023-02-17 17:57:05 +00:00
|
|
|
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StderrHandler))
|
2023-02-15 16:53:28 +00:00
|
|
|
return implemented, err
|
|
|
|
}
|