[dpdk-dev,3/6] test/test: mark tests as skipped when required lib not available
Checks
Commit Message
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(+)
Comments
Hi Bruce,
On 31/1/2018 5:42 PM, Bruce Richardson wrote:
> 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(+)
--snip--
Acked-by David Hunt <david.hunt@intel.com>
@@ -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);
@@ -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);
@@ -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);
@@ -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);