提交 825d357a 编写于 作者: C Cole Robinson

tests: Add newlines with VIR_TEST_REGENERATE_OUTPUT

Since test files are formatted predictably nowadays, we can make
VIR_TEST_REGENERATE_OUTPUT handle most cases for us with a simple
replacement. test-wrap-argv.pl is still canon, but this bit makes
it easier to confirm test output changes during active development.
上级 f988ecfb
......@@ -469,10 +469,19 @@ virtTestDifferenceFullInternal(FILE *stream,
actualStart = actual;
actualEnd = actual + (strlen(actual)-1);
if (regenerate && virTestGetRegenerate() > 0) {
if (regenerate && (virTestGetRegenerate() > 0) && expectName && actual) {
char *regencontent;
/* Try to properly indent qemu argv files */
if (!(regencontent = virStringReplace(actual, " -", " \\\n-")))
return -1;
if (expectName && actual &&
virFileWriteStr(expectName, actual, 0666) < 0)
virFileWriteStr(expectName, regencontent, 0666) < 0) {
VIR_FREE(regencontent);
return -1;
}
VIR_FREE(regencontent);
}
if (!virTestGetDebug())
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册