[TESTS] prevent overriding testlogger when calling mainApp

This commit is contained in:
oliverpool 2024-03-27 22:02:51 +01:00
parent 883cb2d542
commit 5785ae72c7
5 changed files with 75 additions and 63 deletions

View file

@ -128,6 +128,11 @@ func (w *testLoggerWriterCloser) recordError(msg string) {
err = w.errs[len(w.errs)-1]
}
if len(w.t) > 0 {
// format error message to easily add it to the ignore list
msg = fmt.Sprintf("// %s\n\t`%s`,", w.t[len(w.t)-1].Name(), msg)
}
err = errors.Join(err, errors.New(msg))
if len(w.errs) > 0 {