diff --git a/tests/meson.build b/tests/meson.build index 1149211756..3365dce307 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -208,6 +208,7 @@ tests_deps += executable( ], ) +subdir('schemas') # build and define libvirt tests diff --git a/tests/schemas/cpu-baseline.rng.in b/tests/schemas/cpu-baseline.rng.in new file mode 100644 index 0000000000..1a3b19a45b --- /dev/null +++ b/tests/schemas/cpu-baseline.rng.in @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x86 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/schemas/meson.build b/tests/schemas/meson.build new file mode 100644 index 0000000000..33c16bb2fb --- /dev/null +++ b/tests/schemas/meson.build @@ -0,0 +1,16 @@ +# we need to replace proper paths to our schemas in the test schemas +virschematest_test_schemas_conf = configuration_data({ + 'SCHEMADIR': meson.project_source_root() / 'src' / 'conf' / 'schemas', +}) + +virschematest_schemas = [ + 'cpu-baseline.rng.in', +] + +foreach file : virschematest_schemas + configure_file( + input: file, + output: '@BASENAME@', + configuration: virschematest_test_schemas_conf, + ) +endforeach diff --git a/tests/virschematest.c b/tests/virschematest.c index 2a89f6a1c0..29a1d59134 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -318,13 +318,8 @@ static const struct testSchemaEntry schemaStorageVol[] = { { .file = "examples/xml/test/testvol.xml" }, }; -static const struct testSchemaEntry schemaCpu[] = { - { . dir = "tests/cputestdata", - . dirRegex = "^[^-]+-cpuid-.*(-host|-guest|-json)\\.xml$" }, - { . dir = "tests/cputestdata", - . dirRegex = "^[^-]+-baseline-.*-result\\.xml$" }, - { . dir = "tests/cputestdata", - . dirRegex = "^[^-]+-(?!cpuid|baseline).*$" }, +static const struct testSchemaEntry testsCpuBaseline[] = { + { . dir = "tests/cputestdata" }, }; static int @@ -333,6 +328,7 @@ mymain(void) int ret = 0; #define SCHEMAS_PATH abs_top_srcdir "/src/conf/schemas/" +#define INTERNAL_SCHEMAS_PATH abs_builddir "/schemas/" #define DO_TEST(sch, ent) \ if (testSchemaEntries((sch), (ent), G_N_ELEMENTS(ent)) < 0) \ @@ -354,7 +350,8 @@ mymain(void) DO_TEST(SCHEMAS_PATH "storagepoolcaps.rng", schemaStoragepoolcaps); DO_TEST(SCHEMAS_PATH "storagepool.rng", schemaStoragePool); DO_TEST(SCHEMAS_PATH "storagevol.rng", schemaStorageVol); - DO_TEST(SCHEMAS_PATH "cpu.rng", schemaCpu); + + DO_TEST(INTERNAL_SCHEMAS_PATH "cpu-baseline.rng", testsCpuBaseline); return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; }