]> git.droids-corp.org - dpdk.git/commitdiff
test: skip when required lib not available
authorBruce Richardson <bruce.richardson@intel.com>
Thu, 1 Feb 2018 14:20:09 +0000 (14:20 +0000)
committerBruce Richardson <bruce.richardson@intel.com>
Fri, 2 Feb 2018 10:37:52 +0000 (11:37 +0100)
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>
Acked-by: David Hunt <david.hunt@intel.com>
test/test/test_kni.c
test/test/test_power.c
test/test/test_power_acpi_cpufreq.c
test/test/test_power_kvm_vm.c

index c6867f256d7062e46f0b6b8eecc18fc78dda30f3..e4839cdb74740856086eba876c5a8c078945258c 100644 (file)
 
 #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>
@@ -609,4 +620,6 @@ fail:
        return ret;
 }
 
+#endif
+
 REGISTER_TEST_COMMAND(kni_autotest, test_kni);
index d601a2730add40342404d93d4bf0bb084f49b84e..a0ee219830ff1b0e95c5e820c993ba95ce51c94a 100644 (file)
 
 #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 @@ fail_all:
        rte_power_unset_env();
        return -1;
 }
+#endif
 
 REGISTER_TEST_COMMAND(power_autotest, test_power);
index ad948fbe1f1a829e8bf9c3a05bdea9a18562ae15..3bfd033518875c1d3e4a3c01e412dbf1758de1ca 100644 (file)
 
 #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 @@ fail_all:
        rte_power_unset_env();
        return -1;
 }
+#endif
 
 REGISTER_TEST_COMMAND(power_acpi_cpufreq_autotest, test_power_acpi_cpufreq);
index 97b8af9b5bb6160995a54803ce8e7dba44fb77b3..91b31c442a3f33b518b4afeaf34234ce5cfbd615 100644 (file)
 
 #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 @@ fail_all:
        rte_power_unset_env();
        return -1;
 }
+#endif
 
 REGISTER_TEST_COMMAND(power_kvm_vm_autotest, test_power_kvm_vm);