DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	David Hunt <david.hunt@intel.com>
Subject: [dpdk-dev] [PATCH 3/6] test/test: mark tests as skipped when required lib not available
Date: Wed, 31 Jan 2018 17:42:46 +0000	[thread overview]
Message-ID: <20180131174249.257933-4-bruce.richardson@intel.com> (raw)
In-Reply-To: <20180131174249.257933-1-bruce.richardson@intel.com>

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 <bruce.richardson@intel.com>
CC: Ferruh Yigit <ferruh.yigit@intel.com>
CC: David Hunt <david.hunt@intel.com>
---
 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 539d23184..c669785ae 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 <rte_string_fns.h>
 #include <rte_mempool.h>
 #include <rte_ethdev.h>
@@ -605,4 +616,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 <rte_power.h>
 
 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 <rte_power.h>
 
 #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 <rte_power.h>
 
 #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);
-- 
2.14.1

  parent reply	other threads:[~2018-01-31 17:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 17:42 [dpdk-dev] [PATCH 0/6] Fix meson build on FreeBSD Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 1/6] eal/bsdapp: fix building kernel modules Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 2/6] build: add dependency on execinfo for BSD meson builds Bruce Richardson
2018-01-31 17:42 ` Bruce Richardson [this message]
2018-02-01 16:32   ` [dpdk-dev] [PATCH 3/6] test/test: mark tests as skipped when required lib not available Hunt, David
2018-01-31 17:42 ` [dpdk-dev] [PATCH 4/6] test/test: fix dependency on power lib for BSD meson build Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 5/6] test/test: fix dependency on KNI " Bruce Richardson
2018-01-31 17:42 ` [dpdk-dev] [PATCH 6/6] examples: fix meson build on FreeBSD Bruce Richardson
2018-02-01 14:20 ` [dpdk-dev] [PATCH v2 0/5] Fix " Bruce Richardson
2018-02-01 14:20   ` [dpdk-dev] [PATCH v2 1/5] eal/bsdapp: fix building kernel modules Bruce Richardson
2018-02-01 14:20   ` [dpdk-dev] [PATCH v2 2/5] build: fix dependency on execinfo for BSD meson builds Bruce Richardson
2018-02-01 14:20   ` [dpdk-dev] [PATCH v2 3/5] test/test: mark tests as skipped when required lib not available Bruce Richardson
2018-02-01 14:20   ` [dpdk-dev] [PATCH v2 4/5] test/test: fix dependency on power lib for BSD meson build Bruce Richardson
2018-02-01 14:20   ` [dpdk-dev] [PATCH v2 5/5] test/test: fix dependency on KNI " Bruce Richardson
2018-02-02 11:11   ` [dpdk-dev] [PATCH v2 0/5] Fix meson build on FreeBSD Bruce Richardson

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=20180131174249.257933-4-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.hunt@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.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).