On Wed, 2021-05-19 at 10:46 +0200, Michal Prívozník wrote:
On 5/14/21 11:28 PM, Jonathon Jongsma wrote:
> Currently, we're loading and parsing the xml from the input file,
> and
> then formatting it and then comparing it directly back to the input
> file. This works for now, but is severely limiting as it relies on
> the
> input file being fully-specified and in the exact order as the
> output
> xml format.
>
> If optional elements are ommitted in the input XML, the output xml
> may include default values for the ommitted elements and thus the
> output
> will not match the input.
>
> In order to allow more flexibility in testing, save the expected
> output
> to a seprate 'out' directory similar to what most of the other
> xml2xml
> tests are already doing.
>
> Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
> ---
Fair enough - we have plenty of examples around, qemuxml2xmloutdata/
to
name the biggest one. However, what we also do (to save disk space)
is
to turn those files where input XML is the same as output XML into
symlinks. I've identified a few which could be just a symlink:
tests/nodedevxml2xmlout $ for i in *; do if diff $i
../nodedevschemadata/$i >/dev/null ; then echo $i; fi; done
DVD_GCC_4247N.xml
DVD_with_media.xml
ap_07_0038.xml
ap_card07.xml
ap_matrix.xml
ap_matrix_mdev_types.xml
....
I know you are modifying some of these files (mdev*), that's why I
ran
the command only after all your patches. For these patches we could
make
everything a symlink in 1/4 and then as we need to make changes (in
2/4
and 3/4) remove those symlinks and make regular copies.
Do you think it's worth doing? If so, no need to resend, it's
something
I can fix before pushing. Plus marking @outfile variable in
testCompareXMLToXMLHelper() as g_autofree (thanks to Pavel who
noticed!).
Sure, that's fine with me. The vast majority of these files are staying
the same (which is why the tests currently pass -- the output is
identical to the input). So symlinks should be fine for those.
Thanks,
Jonathon