From patchwork Thu Feb 1 14:20:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 34844 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08EEF1B1BF; Thu, 1 Feb 2018 15:20:44 +0100 (CET) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 0AADCA496 for ; Thu, 1 Feb 2018 15:20:42 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Feb 2018 06:20:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,444,1511856000"; d="scan'208";a="200553791" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.223]) by fmsmga006.fm.intel.com with ESMTP; 01 Feb 2018 06:20:41 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Ferruh Yigit , David Hunt Date: Thu, 1 Feb 2018 14:20:09 +0000 Message-Id: <20180201142011.133441-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180201142011.133441-1-bruce.richardson@intel.com> References: <20180131174249.257933-1-bruce.richardson@intel.com> <20180201142011.133441-1-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH v2 3/5] test/test: mark tests as skipped when required lib not available X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The power management and KNI libraries are not compiled on a FreeBSD platform, which means that the tests can't run. Add in stub code for these cases, allowing the tests to still be compiled, but to report as skipped in those cases. Signed-off-by: Bruce Richardson CC: Ferruh Yigit CC: David Hunt --- test/test/test_kni.c | 13 +++++++++++++ test/test/test_power.c | 12 ++++++++++++ test/test/test_power_acpi_cpufreq.c | 11 +++++++++++ test/test/test_power_kvm_vm.c | 11 +++++++++++ 4 files changed, 47 insertions(+) diff --git a/test/test/test_kni.c b/test/test/test_kni.c index c6867f256..e4839cdb7 100644 --- a/test/test/test_kni.c +++ b/test/test/test_kni.c @@ -10,6 +10,17 @@ #include "test.h" +#ifndef RTE_LIBRTE_KNI + +static int +test_kni(void) +{ + printf("KNI not supported, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include #include #include @@ -609,4 +620,6 @@ test_kni(void) return ret; } +#endif + REGISTER_TEST_COMMAND(kni_autotest, test_kni); diff --git a/test/test/test_power.c b/test/test/test_power.c index d601a2730..a0ee21983 100644 --- a/test/test/test_power.c +++ b/test/test/test_power.c @@ -10,6 +10,17 @@ #include "test.h" +#ifndef RTE_LIBRTE_POWER + +static int +test_power(void) +{ + printf("Power management library not supported, skipping test\n"); + return TEST_SKIPPED; +} + +#else + #include static int @@ -74,5 +85,6 @@ test_power(void) rte_power_unset_env(); return -1; } +#endif REGISTER_TEST_COMMAND(power_autotest, test_power); diff --git a/test/test/test_power_acpi_cpufreq.c b/test/test/test_power_acpi_cpufreq.c index ad948fbe1..3bfd03351 100644 --- a/test/test/test_power_acpi_cpufreq.c +++ b/test/test/test_power_acpi_cpufreq.c @@ -10,6 +10,16 @@ #include "test.h" +#ifndef RTE_LIBRTE_POWER + +static int +test_power_acpi_cpufreq(void) +{ + printf("Power management library not supported, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include #define TEST_POWER_LCORE_ID 2U @@ -507,5 +517,6 @@ test_power_acpi_cpufreq(void) rte_power_unset_env(); return -1; } +#endif REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq); diff --git a/test/test/test_power_kvm_vm.c b/test/test/test_power_kvm_vm.c index 97b8af9b5..91b31c442 100644 --- a/test/test/test_power_kvm_vm.c +++ b/test/test/test_power_kvm_vm.c @@ -10,6 +10,16 @@ #include "test.h" +#ifndef RTE_LIBRTE_POWER + +static int +test_power_kvm_vm(void) +{ + printf("Power management library not supported, skipping test\n"); + return TEST_SKIPPED; +} + +#else #include #define TEST_POWER_VM_LCORE_ID 0U @@ -270,5 +280,6 @@ test_power_kvm_vm(void) rte_power_unset_env(); return -1; } +#endif REGISTER_TEST_COMMAND(power_kvm_vm_autotest, test_power_kvm_vm);