virshtest: Test against output files ("echo" tests)

Managing output files is much simpler especially with
VIR_TEST_REGENERATE_OUTPUT compared to putting the expected string blobs
into the C source file.

For now the output is tested both against the hardcoded strings as well
as the output files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2024-03-12 14:13:19 +01:00
parent c63b5ee98b
commit d15b79a35c
31 changed files with 43 additions and 1 deletions

View File

@ -585,7 +585,7 @@ mymain(void)
do { \
const char *testname = testname_; \
const char *myargv[] = { __VA_ARGS__, NULL }; \
const struct testInfo info = { NULL, NULL, myargv, result }; \
const struct testInfo info = { testname, NULL, myargv, result }; \
if (virTestRun(testname, testCompare, &info) < 0) \
ret = -1; \
} while (0)

View File

@ -0,0 +1 @@
a

View File

@ -0,0 +1 @@
a

View File

@ -0,0 +1 @@
a --shell

View File

@ -0,0 +1 @@
-- --shell a

View File

@ -0,0 +1 @@
a

View File

@ -0,0 +1 @@
--shell a

View File

@ -0,0 +1 @@
hello

View File

@ -0,0 +1,2 @@
a A 0 + * ; . ' " / ? =
< > &

View File

@ -0,0 +1,2 @@
a A 0 + '*' ';' . ''\''' '"' / '?' = ' ' '
' '<' '>' '&'

View File

@ -0,0 +1,2 @@
a A 0 + * ; . &apos; &quot; / ? =
&lt; &gt; &amp;

View File

@ -0,0 +1 @@
a b

View File

@ -0,0 +1 @@
a b

View File

@ -0,0 +1 @@
a b

View File

@ -0,0 +1 @@
a b

View File

@ -0,0 +1 @@
' " \;echo a

View File

@ -0,0 +1 @@
' " ;echo a

View File

@ -0,0 +1,2 @@
' " \
a

View File

@ -0,0 +1 @@
' " \\

View File

@ -0,0 +1,2 @@
a
b

View File

@ -0,0 +1 @@
a # b

View File

@ -0,0 +1 @@
a

View File

@ -0,0 +1 @@
a

View File

@ -0,0 +1,2 @@
a
b

View File

@ -0,0 +1,2 @@
a
b

View File

@ -0,0 +1,2 @@
a
b

View File

@ -0,0 +1,3 @@
a
\
b

View File

@ -0,0 +1 @@
a

View File

@ -0,0 +1,2 @@
a
c

View File

@ -0,0 +1,2 @@
a
c

View File

@ -0,0 +1 @@
a # b