mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
tests: Better support for VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES
https://bugzilla.redhat.com/show_bug.cgi?id=1049391 virConnectBaselineCPU test results are now stored in different files depending on VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES. (cherry picked from commit 0e9373a5c04e5c69a95b6d1cae7cad8456332be7)
This commit is contained in:
parent
844476f1f2
commit
71ed29bb54
@ -326,6 +326,7 @@ cpuTestBaseline(const void *arg)
|
|||||||
virCPUDefPtr baseline = NULL;
|
virCPUDefPtr baseline = NULL;
|
||||||
unsigned int ncpus = 0;
|
unsigned int ncpus = 0;
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
|
const char *suffix;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!(cpus = cpuTestLoadMultiXML(data->arch, data->name, &ncpus)))
|
if (!(cpus = cpuTestLoadMultiXML(data->arch, data->name, &ncpus)))
|
||||||
@ -345,7 +346,11 @@ cpuTestBaseline(const void *arg)
|
|||||||
if (!baseline)
|
if (!baseline)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (virAsprintf(&result, "%s-result", data->name) < 0)
|
if (data->flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES)
|
||||||
|
suffix = "expanded";
|
||||||
|
else
|
||||||
|
suffix = "result";
|
||||||
|
if (virAsprintf(&result, "%s-%s", data->name, suffix) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (cpuTestCompareXML(data->arch, baseline, result, 0) < 0)
|
if (cpuTestCompareXML(data->arch, baseline, result, 0) < 0)
|
||||||
@ -537,8 +542,19 @@ mymain(void)
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define DO_TEST_BASELINE(arch, name, flags, result) \
|
#define DO_TEST_BASELINE(arch, name, flags, result) \
|
||||||
DO_TEST(arch, API_BASELINE, name, NULL, "baseline-" name, \
|
do { \
|
||||||
NULL, 0, NULL, flags, result)
|
const char *suffix = ""; \
|
||||||
|
char *label; \
|
||||||
|
if ((flags) & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES) \
|
||||||
|
suffix = " (expanded)"; \
|
||||||
|
if (virAsprintf(&label, "%s%s", name, suffix) < 0) { \
|
||||||
|
ret = -1; \
|
||||||
|
} else { \
|
||||||
|
DO_TEST(arch, API_BASELINE, label, NULL, "baseline-" name, \
|
||||||
|
NULL, 0, NULL, flags, result); \
|
||||||
|
} \
|
||||||
|
VIR_FREE(label); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#define DO_TEST_HASFEATURE(arch, host, feature, result) \
|
#define DO_TEST_HASFEATURE(arch, host, feature, result) \
|
||||||
DO_TEST(arch, API_HAS_FEATURE, \
|
DO_TEST(arch, API_HAS_FEATURE, \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user