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-04-02 14:24:30 +02:00
parent c63b5ee98b
commit d15b79a35c
31 changed files with 43 additions and 1 deletions
+1 -1
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)
@@ -0,0 +1 @@
a
@@ -0,0 +1 @@
a
@@ -0,0 +1 @@
a --shell
@@ -0,0 +1 @@
-- --shell a
@@ -0,0 +1 @@
a
@@ -0,0 +1 @@
--shell a
+1
View File
@@ -0,0 +1 @@
hello
+2
View File
@@ -0,0 +1,2 @@
a A 0 + * ; . ' " / ? =
< > &
+2
View File
@@ -0,0 +1,2 @@
a A 0 + '*' ';' . ''\''' '"' / '?' = ' ' '
' '<' '>' '&'
+2
View File
@@ -0,0 +1,2 @@
a A 0 + * ; . &apos; &quot; / ? =
&lt; &gt; &amp;
@@ -0,0 +1 @@
a b
@@ -0,0 +1 @@
a b
@@ -0,0 +1 @@
a b
@@ -0,0 +1 @@
a b
@@ -0,0 +1 @@
' " \;echo a
@@ -0,0 +1 @@
' " ;echo a
@@ -0,0 +1,2 @@
' " \
a
@@ -0,0 +1 @@
' " \\
@@ -0,0 +1,2 @@
a
b
@@ -0,0 +1 @@
a # b
@@ -0,0 +1 @@
a
@@ -0,0 +1 @@
a
@@ -0,0 +1,2 @@
a
b
@@ -0,0 +1,2 @@
a
b
@@ -0,0 +1,2 @@
a
b
@@ -0,0 +1,3 @@
a
\
b
@@ -0,0 +1 @@
a
@@ -0,0 +1,2 @@
a
c
@@ -0,0 +1,2 @@
a
c
@@ -0,0 +1 @@
a # b