From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, Andrew Jones <drjones@redhat.com>
Subject: Re: [kvm-unit-tests PATCH v4 02/13] x86/*: report skipped tests
Date: Wed, 25 May 2016 19:19:28 +0200 [thread overview]
Message-ID: <20160525171927.GA8077@potion> (raw)
In-Reply-To: <573B0C67.8010707@redhat.com>
2016-05-17 14:19+0200, Paolo Bonzini:
> On 11/05/2016 18:12, Radim Krčmář wrote:
>> if (!(cpuid_indexed(7, 0).c & (1 << X86_FEATURE_PKU))) {
>> printf("PKU not enabled, aborting\n");
>> - abort();
>> + return report_summary();
>
> Needs report_skip?
>
>> diff --git a/x86/pmu.c b/x86/pmu.c
>> @@ -387,7 +387,7 @@ int main(int ac, char **av)
>> if (!eax.split.version_id) {
>> printf("No pmu is detected!\n");
>> - return 1;
>> + return report_summary();
>
> Needs report_skip?
>
>> diff --git a/x86/smap.c b/x86/smap.c
>> @@ -93,7 +93,7 @@ int main(int ac, char **av)
>> if (!(cpuid_indexed(7, 0).b & (1 << X86_FEATURE_SMAP))) {
>> printf("SMAP not enabled, aborting\n");
>> - abort();
>> + return report_summary();
>
> Needs report_skip?
>
>> diff --git a/x86/svm.c b/x86/svm.c
>> if (!(cpuid(0x80000001).c & 4)) {
>> printf("SVM not availble\n");
>> - return 0;
>> + return report_summary();
>
> Needs report_skip?
>
>> diff --git a/x86/tsc.c b/x86/tsc.c
>> printf("rdtscp not supported\n");
>
> Needs report_skip?
>
>> - return 0;
>> + return report_summary();
>
> Just sending a fixup patch is enough.
report_skip is not needed, because the a test that ended in
report_summary without any report is considered as skipped.
The fixup below turns printfs to report_skip is below. The difference
is that summary will now print
SKIP pku (1 tests, 1 skipped)
instead of previous
SKIP pku (0 tests)
I like "0 tests" summary better and only x86/hyperv_synic does the
opposite, so a fix could go both ways.
---8<---
diff --git a/x86/pku.c b/x86/pku.c
index 6214f0bc151f..4b418fdc8a20 100644
--- a/x86/pku.c
+++ b/x86/pku.c
@@ -67,7 +67,7 @@ int main(int ac, char **av)
unsigned int pkru_wd = 0x20;
if (!(cpuid_indexed(7, 0).c & (1 << X86_FEATURE_PKU))) {
- printf("PKU not enabled, aborting\n");
+ report_skip("PKU not enabled\n");
return report_summary();
}
diff --git a/x86/pmu.c b/x86/pmu.c
index b0f9f81af68e..308274761336 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -390,7 +390,7 @@ int main(int ac, char **av)
host_nmi_watchdog = atol_keyval(ac, av, "host_nmi_watchdog");
if (!eax.split.version_id) {
- printf("No pmu is detected!\n");
+ report_skip("No pmu is detected!\n");
return report_summary();
}
printf("PMU version: %d\n", eax.split.version_id);
diff --git a/x86/smap.c b/x86/smap.c
index c9de081a474b..23722beb00f5 100644
--- a/x86/smap.c
+++ b/x86/smap.c
@@ -92,7 +92,7 @@ int main(int ac, char **av)
unsigned long i;
if (!(cpuid_indexed(7, 0).b & (1 << X86_FEATURE_SMAP))) {
- printf("SMAP not enabled, aborting\n");
+ report_skip("SMAP not enabled\n");
return report_summary();
}
diff --git a/x86/svm.c b/x86/svm.c
index 301cf8cb2d6b..005cbf7c3352 100644
--- a/x86/svm.c
+++ b/x86/svm.c
@@ -1063,7 +1063,7 @@ int main(int ac, char **av)
smp_init();
if (!(cpuid(0x80000001).c & 4)) {
- printf("SVM not availble\n");
+ report_skip("SVM not availble\n");
return report_summary();
}
diff --git a/x86/tsc.c b/x86/tsc.c
index 62450e71725c..33fdc114c04c 100644
--- a/x86/tsc.c
+++ b/x86/tsc.c
@@ -42,6 +42,6 @@ int main()
test_rdtscp(10);
test_rdtscp(0x100);
} else
- printf("rdtscp not supported\n");
+ report_skip("rdtscp not supported\n");
return report_summary();
}
next prev parent reply other threads:[~2016-05-25 17:19 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-11 16:12 [kvm-unit-tests PATCH v4 00/13] Improve the output of test runners Radim Krčmář
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 01/13] lib/report: allow test skipping Radim Krčmář
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 02/13] x86/*: report skipped tests Radim Krčmář
2016-05-17 12:19 ` Paolo Bonzini
2016-05-25 17:19 ` Radim Krčmář [this message]
2016-05-25 17:23 ` Radim Krčmář
2016-05-26 7:22 ` Paolo Bonzini
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 03/13] x86/unittests: remove svm-disabled Radim Krčmář
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 04/13] lib/string: add strncmp Radim Krčmář
2016-05-11 16:33 ` Andrew Jones
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 05/13] lib/util: add args_parse_keyval Radim Krčmář
2016-05-11 16:58 ` Andrew Jones
2016-05-11 17:19 ` Radim Krčmář
2016-05-11 17:23 ` Andrew Jones
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 06/13] x86/pmu: expect failure with nmi_watchdog Radim Krčmář
2016-05-11 17:00 ` Andrew Jones
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 07/13] lib/report: don't print 0 failed tests Radim Krčmář
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 08/13] scripts/runtime: consolidate summary tags Radim Krčmář
2016-05-17 12:22 ` Paolo Bonzini
2016-05-25 17:46 ` Radim Krčmář
2016-05-11 16:12 ` [kvm-unit-tests PATCH v4 09/13] run_tests: print SUMMARY line in summary Radim Krčmář
2016-05-11 17:10 ` Andrew Jones
2016-05-17 12:32 ` Paolo Bonzini
2016-05-25 17:41 ` Radim Krčmář
2016-05-11 16:30 ` [kvm-unit-tests PATCH v4 10/13] run_tests: log stderr Radim Krčmář
2016-05-11 16:30 ` [kvm-unit-tests PATCH v4 11/13] scripts/runtime: skip tests that cannot run Radim Krčmář
2016-05-11 17:20 ` Andrew Jones
2016-05-11 16:30 ` [kvm-unit-tests PATCH v4 12/13] scripts/arch-run: change QEMU failure detection Radim Krčmář
2016-05-11 17:24 ` Andrew Jones
2016-05-11 16:30 ` [kvm-unit-tests PATCH v4 13/13] scripts/run: generalize check Radim Krčmář
2016-05-11 17:31 ` Andrew Jones
2016-05-11 17:11 ` [kvm-unit-tests PATCH v4 10/13] run_tests: log stderr Andrew Jones
2016-05-17 12:29 ` [kvm-unit-tests PATCH v4 00/13] Improve the output of test runners Paolo Bonzini
2016-05-25 17:49 ` Radim Krčmář
2016-05-26 7:25 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160525171927.GA8077@potion \
--to=rkrcmar@redhat.com \
--cc=drjones@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).