Message ID | 1472665923-15759-1-git-send-email-debmc@linux.vnet.ibm.com |
---|---|
State | Accepted |
Headers | show |
On 31/08/16 18:52, Deb McLemore wrote: > Set the ACPI platform check to undefine the PPC64 to properly > conditionally build the tests on the respective platforms. > > Cleanup messages to properly identify per platform the > FW feature flag being checked. > > Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com> > --- > src/acpi/wakealarm/wakealarm.c | 4 ++++ > src/bios/hdaaudio/hdaaudio.c | 4 ++++ > src/kernel/version/version.c | 4 ++++ > src/lib/include/fwts.h | 4 ++-- > src/lib/src/fwts_framework.c | 13 ++++++++++--- > src/opal/prd_info.c | 5 +++-- > 6 files changed, 27 insertions(+), 7 deletions(-) > > diff --git a/src/acpi/wakealarm/wakealarm.c b/src/acpi/wakealarm/wakealarm.c > index 32bf3c4..0251079 100644 > --- a/src/acpi/wakealarm/wakealarm.c > +++ b/src/acpi/wakealarm/wakealarm.c > @@ -18,6 +18,8 @@ > */ > #include "fwts.h" > > +#if defined(FWTS_HAS_ACPI) > + > #include <stdlib.h> > #include <stdio.h> > #include <sys/types.h> > @@ -171,3 +173,5 @@ static fwts_framework_ops wakealarm_ops = { > }; > > FWTS_REGISTER("wakealarm", &wakealarm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV) > + > +#endif > diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c > index 8aa5ce9..cd943ee 100644 > --- a/src/bios/hdaaudio/hdaaudio.c > +++ b/src/bios/hdaaudio/hdaaudio.c > @@ -21,6 +21,8 @@ > > #include "fwts.h" > > +#ifdef FWTS_ARCH_INTEL > + > typedef struct { > uint16_t pin; > uint32_t setting; > @@ -189,3 +191,5 @@ static fwts_framework_ops hda_audio_ops = { > }; > > FWTS_REGISTER("hda_audio", &hda_audio_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH) > + > +#endif > diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c > index 2615998..5432f60 100644 > --- a/src/kernel/version/version.c > +++ b/src/kernel/version/version.c > @@ -85,6 +85,7 @@ static int version_test3(fwts_framework *fw) > return FWTS_OK; > } > > +#if defined(FWTS_HAS_ACPI) > static int version_test4(fwts_framework *fw) > { > char *str; > @@ -104,12 +105,15 @@ static int version_test4(fwts_framework *fw) > > return FWTS_OK; > } > +#endif > > static fwts_framework_minor_test version_tests[] = { > { version_test1, "Gather kernel signature." }, > { version_test2, "Gather kernel system information." }, > { version_test3, "Gather kernel boot command line." }, > +#if defined(FWTS_HAS_ACPI) > { version_test4, "Gather ACPI driver version." }, > +#endif > { NULL, NULL }, > }; > > diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h > index 780c308..42f454e 100644 > --- a/src/lib/include/fwts.h > +++ b/src/lib/include/fwts.h > @@ -40,8 +40,8 @@ > #endif > > #if defined(__PPC64__) > -#define FWTS_HAS_ACPI 0 > -#define FWTS_HAS_UEFI 0 > +#undef FWTS_HAS_ACPI > +#undef FWTS_HAS_UEFI > #endif > > #define FWTS_UNUSED(var) (void)var > diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c > index 9c2d3df..a296f93 100644 > --- a/src/lib/src/fwts_framework.c > +++ b/src/lib/src/fwts_framework.c > @@ -600,18 +600,25 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test > fw->total.aborted += test->ops->total_tests; > if (fw->show_progress) { > fwts_framework_minor_test_progress_clear_line(); > - fprintf(stderr, " Test aborted.\n"); > + fprintf(stderr, " Test aborted\n"); > } > goto done; > } > > if (!fwts_firmware_has_features(test->fw_features)) { > int missing = test->fw_features & ~fwts_firmware_features(); > + char *msg = NULL; > fwts_log_info(fw, "Test skipped, missing features: %s", > fwts_firmware_feature_string(missing)); > fw->current_major_test->results.skipped += > test->ops->total_tests; > fw->total.skipped += test->ops->total_tests; > + msg = "Test skipped, missing features"; > + if (fw->show_progress) { > + fwts_framework_minor_test_progress_clear_line(); > + fprintf(stderr, " %s: %s\n", > + msg, fwts_firmware_feature_string(missing)); > + } > goto done; > } > > @@ -623,12 +630,12 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test > if (ret == FWTS_SKIP) { > fw->current_major_test->results.skipped += test->ops->total_tests; > fw->total.skipped += test->ops->total_tests; > - msg = "Test skipped."; > + msg = "Test skipped"; > } else { > fwts_log_error(fw, "Aborted test, initialisation failed."); > fw->current_major_test->results.aborted += test->ops->total_tests; > fw->total.aborted += test->ops->total_tests; > - msg = "Test aborted."; > + msg = "Test aborted"; > } > if (fw->show_progress) { > fwts_framework_minor_test_progress_clear_line(); > diff --git a/src/opal/prd_info.c b/src/opal/prd_info.c > index bdbfb9d..d529504 100644 > --- a/src/opal/prd_info.c > +++ b/src/opal/prd_info.c > @@ -227,5 +227,6 @@ static fwts_framework_ops prd_info_ops = { > .minor_tests = prd_info_tests > }; > > -FWTS_REGISTER("prd_info", &prd_info_ops, FWTS_TEST_EARLY, > - FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV) > +FWTS_REGISTER_FEATURES("prd_info", &prd_info_ops, FWTS_TEST_EARLY, > + FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV, > + FWTS_FW_FEATURE_DEVICETREE) > Thanks Deb, Acked-by: Colin Ian King <colin.king@canonical.com>
On 2016-09-01 01:52 AM, Deb McLemore wrote: > Set the ACPI platform check to undefine the PPC64 to properly > conditionally build the tests on the respective platforms. > > Cleanup messages to properly identify per platform the > FW feature flag being checked. > > Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com> > --- > src/acpi/wakealarm/wakealarm.c | 4 ++++ > src/bios/hdaaudio/hdaaudio.c | 4 ++++ > src/kernel/version/version.c | 4 ++++ > src/lib/include/fwts.h | 4 ++-- > src/lib/src/fwts_framework.c | 13 ++++++++++--- > src/opal/prd_info.c | 5 +++-- > 6 files changed, 27 insertions(+), 7 deletions(-) > > diff --git a/src/acpi/wakealarm/wakealarm.c b/src/acpi/wakealarm/wakealarm.c > index 32bf3c4..0251079 100644 > --- a/src/acpi/wakealarm/wakealarm.c > +++ b/src/acpi/wakealarm/wakealarm.c > @@ -18,6 +18,8 @@ > */ > #include "fwts.h" > > +#if defined(FWTS_HAS_ACPI) > + > #include <stdlib.h> > #include <stdio.h> > #include <sys/types.h> > @@ -171,3 +173,5 @@ static fwts_framework_ops wakealarm_ops = { > }; > > FWTS_REGISTER("wakealarm", &wakealarm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV) > + > +#endif > diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c > index 8aa5ce9..cd943ee 100644 > --- a/src/bios/hdaaudio/hdaaudio.c > +++ b/src/bios/hdaaudio/hdaaudio.c > @@ -21,6 +21,8 @@ > > #include "fwts.h" > > +#ifdef FWTS_ARCH_INTEL > + > typedef struct { > uint16_t pin; > uint32_t setting; > @@ -189,3 +191,5 @@ static fwts_framework_ops hda_audio_ops = { > }; > > FWTS_REGISTER("hda_audio", &hda_audio_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH) > + > +#endif > diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c > index 2615998..5432f60 100644 > --- a/src/kernel/version/version.c > +++ b/src/kernel/version/version.c > @@ -85,6 +85,7 @@ static int version_test3(fwts_framework *fw) > return FWTS_OK; > } > > +#if defined(FWTS_HAS_ACPI) > static int version_test4(fwts_framework *fw) > { > char *str; > @@ -104,12 +105,15 @@ static int version_test4(fwts_framework *fw) > > return FWTS_OK; > } > +#endif > > static fwts_framework_minor_test version_tests[] = { > { version_test1, "Gather kernel signature." }, > { version_test2, "Gather kernel system information." }, > { version_test3, "Gather kernel boot command line." }, > +#if defined(FWTS_HAS_ACPI) > { version_test4, "Gather ACPI driver version." }, > +#endif > { NULL, NULL }, > }; > > diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h > index 780c308..42f454e 100644 > --- a/src/lib/include/fwts.h > +++ b/src/lib/include/fwts.h > @@ -40,8 +40,8 @@ > #endif > > #if defined(__PPC64__) > -#define FWTS_HAS_ACPI 0 > -#define FWTS_HAS_UEFI 0 > +#undef FWTS_HAS_ACPI > +#undef FWTS_HAS_UEFI > #endif > > #define FWTS_UNUSED(var) (void)var > diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c > index 9c2d3df..a296f93 100644 > --- a/src/lib/src/fwts_framework.c > +++ b/src/lib/src/fwts_framework.c > @@ -600,18 +600,25 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test > fw->total.aborted += test->ops->total_tests; > if (fw->show_progress) { > fwts_framework_minor_test_progress_clear_line(); > - fprintf(stderr, " Test aborted.\n"); > + fprintf(stderr, " Test aborted\n"); > } > goto done; > } > > if (!fwts_firmware_has_features(test->fw_features)) { > int missing = test->fw_features & ~fwts_firmware_features(); > + char *msg = NULL; > fwts_log_info(fw, "Test skipped, missing features: %s", > fwts_firmware_feature_string(missing)); > fw->current_major_test->results.skipped += > test->ops->total_tests; > fw->total.skipped += test->ops->total_tests; > + msg = "Test skipped, missing features"; > + if (fw->show_progress) { > + fwts_framework_minor_test_progress_clear_line(); > + fprintf(stderr, " %s: %s\n", > + msg, fwts_firmware_feature_string(missing)); > + } > goto done; > } > > @@ -623,12 +630,12 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test > if (ret == FWTS_SKIP) { > fw->current_major_test->results.skipped += test->ops->total_tests; > fw->total.skipped += test->ops->total_tests; > - msg = "Test skipped."; > + msg = "Test skipped"; > } else { > fwts_log_error(fw, "Aborted test, initialisation failed."); > fw->current_major_test->results.aborted += test->ops->total_tests; > fw->total.aborted += test->ops->total_tests; > - msg = "Test aborted."; > + msg = "Test aborted"; > } > if (fw->show_progress) { > fwts_framework_minor_test_progress_clear_line(); > diff --git a/src/opal/prd_info.c b/src/opal/prd_info.c > index bdbfb9d..d529504 100644 > --- a/src/opal/prd_info.c > +++ b/src/opal/prd_info.c > @@ -227,5 +227,6 @@ static fwts_framework_ops prd_info_ops = { > .minor_tests = prd_info_tests > }; > > -FWTS_REGISTER("prd_info", &prd_info_ops, FWTS_TEST_EARLY, > - FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV) > +FWTS_REGISTER_FEATURES("prd_info", &prd_info_ops, FWTS_TEST_EARLY, > + FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV, > + FWTS_FW_FEATURE_DEVICETREE) > Acked-by: Alex Hung <alex.hung@canonical.com>
diff --git a/src/acpi/wakealarm/wakealarm.c b/src/acpi/wakealarm/wakealarm.c index 32bf3c4..0251079 100644 --- a/src/acpi/wakealarm/wakealarm.c +++ b/src/acpi/wakealarm/wakealarm.c @@ -18,6 +18,8 @@ */ #include "fwts.h" +#if defined(FWTS_HAS_ACPI) + #include <stdlib.h> #include <stdio.h> #include <sys/types.h> @@ -171,3 +173,5 @@ static fwts_framework_ops wakealarm_ops = { }; FWTS_REGISTER("wakealarm", &wakealarm_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV) + +#endif diff --git a/src/bios/hdaaudio/hdaaudio.c b/src/bios/hdaaudio/hdaaudio.c index 8aa5ce9..cd943ee 100644 --- a/src/bios/hdaaudio/hdaaudio.c +++ b/src/bios/hdaaudio/hdaaudio.c @@ -21,6 +21,8 @@ #include "fwts.h" +#ifdef FWTS_ARCH_INTEL + typedef struct { uint16_t pin; uint32_t setting; @@ -189,3 +191,5 @@ static fwts_framework_ops hda_audio_ops = { }; FWTS_REGISTER("hda_audio", &hda_audio_ops, FWTS_TEST_ANYTIME, FWTS_FLAG_BATCH) + +#endif diff --git a/src/kernel/version/version.c b/src/kernel/version/version.c index 2615998..5432f60 100644 --- a/src/kernel/version/version.c +++ b/src/kernel/version/version.c @@ -85,6 +85,7 @@ static int version_test3(fwts_framework *fw) return FWTS_OK; } +#if defined(FWTS_HAS_ACPI) static int version_test4(fwts_framework *fw) { char *str; @@ -104,12 +105,15 @@ static int version_test4(fwts_framework *fw) return FWTS_OK; } +#endif static fwts_framework_minor_test version_tests[] = { { version_test1, "Gather kernel signature." }, { version_test2, "Gather kernel system information." }, { version_test3, "Gather kernel boot command line." }, +#if defined(FWTS_HAS_ACPI) { version_test4, "Gather ACPI driver version." }, +#endif { NULL, NULL }, }; diff --git a/src/lib/include/fwts.h b/src/lib/include/fwts.h index 780c308..42f454e 100644 --- a/src/lib/include/fwts.h +++ b/src/lib/include/fwts.h @@ -40,8 +40,8 @@ #endif #if defined(__PPC64__) -#define FWTS_HAS_ACPI 0 -#define FWTS_HAS_UEFI 0 +#undef FWTS_HAS_ACPI +#undef FWTS_HAS_UEFI #endif #define FWTS_UNUSED(var) (void)var diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c index 9c2d3df..a296f93 100644 --- a/src/lib/src/fwts_framework.c +++ b/src/lib/src/fwts_framework.c @@ -600,18 +600,25 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test fw->total.aborted += test->ops->total_tests; if (fw->show_progress) { fwts_framework_minor_test_progress_clear_line(); - fprintf(stderr, " Test aborted.\n"); + fprintf(stderr, " Test aborted\n"); } goto done; } if (!fwts_firmware_has_features(test->fw_features)) { int missing = test->fw_features & ~fwts_firmware_features(); + char *msg = NULL; fwts_log_info(fw, "Test skipped, missing features: %s", fwts_firmware_feature_string(missing)); fw->current_major_test->results.skipped += test->ops->total_tests; fw->total.skipped += test->ops->total_tests; + msg = "Test skipped, missing features"; + if (fw->show_progress) { + fwts_framework_minor_test_progress_clear_line(); + fprintf(stderr, " %s: %s\n", + msg, fwts_firmware_feature_string(missing)); + } goto done; } @@ -623,12 +630,12 @@ static int fwts_framework_run_test(fwts_framework *fw, fwts_framework_test *test if (ret == FWTS_SKIP) { fw->current_major_test->results.skipped += test->ops->total_tests; fw->total.skipped += test->ops->total_tests; - msg = "Test skipped."; + msg = "Test skipped"; } else { fwts_log_error(fw, "Aborted test, initialisation failed."); fw->current_major_test->results.aborted += test->ops->total_tests; fw->total.aborted += test->ops->total_tests; - msg = "Test aborted."; + msg = "Test aborted"; } if (fw->show_progress) { fwts_framework_minor_test_progress_clear_line(); diff --git a/src/opal/prd_info.c b/src/opal/prd_info.c index bdbfb9d..d529504 100644 --- a/src/opal/prd_info.c +++ b/src/opal/prd_info.c @@ -227,5 +227,6 @@ static fwts_framework_ops prd_info_ops = { .minor_tests = prd_info_tests }; -FWTS_REGISTER("prd_info", &prd_info_ops, FWTS_TEST_EARLY, - FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV) +FWTS_REGISTER_FEATURES("prd_info", &prd_info_ops, FWTS_TEST_EARLY, + FWTS_FLAG_BATCH | FWTS_FLAG_ROOT_PRIV, + FWTS_FW_FEATURE_DEVICETREE)
Set the ACPI platform check to undefine the PPC64 to properly conditionally build the tests on the respective platforms. Cleanup messages to properly identify per platform the FW feature flag being checked. Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com> --- src/acpi/wakealarm/wakealarm.c | 4 ++++ src/bios/hdaaudio/hdaaudio.c | 4 ++++ src/kernel/version/version.c | 4 ++++ src/lib/include/fwts.h | 4 ++-- src/lib/src/fwts_framework.c | 13 ++++++++++--- src/opal/prd_info.c | 5 +++-- 6 files changed, 27 insertions(+), 7 deletions(-)