app/test: only build what has been selected in config

Avoid building tests if their counterparts are not selected in config.
This has the nice side effect of fixing build errors when disabling parts of
the dpdk.

Signed-off-by: David Marchand <david.marchand@6wind.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
This commit is contained in:
David Marchand 2014-08-18 13:29:25 +02:00 committed by Thomas Monjalon
parent df21543fe9
commit 7822c43aba
27 changed files with 42 additions and 99 deletions

View File

@ -53,39 +53,57 @@ SRCS-y += test_cycles.c
SRCS-y += test_spinlock.c SRCS-y += test_spinlock.c
SRCS-y += test_memory.c SRCS-y += test_memory.c
SRCS-y += test_memzone.c SRCS-y += test_memzone.c
SRCS-y += test_ring.c SRCS-y += test_ring.c
SRCS-y += test_ring_perf.c
ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y)
SRCS-y += test_table.c SRCS-y += test_table.c
SRCS-y += test_table_pipeline.c SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test_table_pipeline.c
SRCS-y += test_table_tables.c SRCS-y += test_table_tables.c
SRCS-y += test_table_ports.c SRCS-y += test_table_ports.c
SRCS-y += test_table_combined.c SRCS-y += test_table_combined.c
SRCS-y += test_table_acl.c SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_table_acl.c
SRCS-y += test_ring_perf.c endif
SRCS-y += test_rwlock.c SRCS-y += test_rwlock.c
SRCS-y += test_timer.c
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) += test_timer.c
SRCS-$(CONFIG_RTE_LIBRTE_TIMER) += test_timer_perf.c
SRCS-y += test_mempool.c SRCS-y += test_mempool.c
SRCS-y += test_mempool_perf.c SRCS-y += test_mempool_perf.c
SRCS-y += test_mbuf.c SRCS-y += test_mbuf.c
SRCS-y += test_logs.c SRCS-y += test_logs.c
SRCS-y += test_memcpy.c SRCS-y += test_memcpy.c
SRCS-y += test_memcpy_perf.c SRCS-y += test_memcpy_perf.c
SRCS-y += test_hash.c
SRCS-y += test_hash_perf.c SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash.c
SRCS-y += test_lpm.c SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_perf.c
SRCS-y += test_lpm6.c
SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm.c
SRCS-$(CONFIG_RTE_LIBRTE_LPM) += test_lpm6.c
SRCS-y += test_debug.c SRCS-y += test_debug.c
SRCS-y += test_errno.c SRCS-y += test_errno.c
SRCS-y += test_tailq.c SRCS-y += test_tailq.c
SRCS-y += test_string_fns.c SRCS-y += test_string_fns.c
SRCS-y += test_mp_secondary.c
SRCS-y += test_cpuflags.c SRCS-y += test_cpuflags.c
ifeq ($(CONFIG_RTE_EXEC_ENV_BAREMETAL),)
SRCS-y += test_mp_secondary.c
SRCS-y += test_eal_flags.c SRCS-y += test_eal_flags.c
SRCS-y += test_eal_fs.c
endif
SRCS-y += test_alarm.c SRCS-y += test_alarm.c
SRCS-y += test_interrupts.c SRCS-y += test_interrupts.c
SRCS-y += test_version.c SRCS-y += test_version.c
SRCS-y += test_eal_fs.c
SRCS-y += test_func_reentrancy.c SRCS-y += test_func_reentrancy.c
SRCS-y += test_cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_num.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_num.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_etheraddr.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_etheraddr.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_portlist.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_portlist.c
@ -93,16 +111,21 @@ SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_ipaddr.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_cirbuf.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_cirbuf.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_string.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_string.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c
ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y)
SRCS-y += test_red.c SRCS-y += test_red.c
SRCS-y += test_sched.c SRCS-$(CONFIG_RTE_ARCH_X86_64) += test_sched.c
SRCS-y += test_meter.c endif
SRCS-y += test_kni.c
SRCS-y += test_power.c SRCS-$(CONFIG_RTE_LIBRTE_METER) += test_meter.c
SRCS-$(CONFIG_RTE_LIBRTE_KNI) += test_kni.c
SRCS-$(CONFIG_RTE_LIBRTE_POWER) += test_power.c
SRCS-y += test_common.c SRCS-y += test_common.c
SRCS-y += test_timer_perf.c SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += test_ivshmem.c
SRCS-y += test_ivshmem.c
SRCS-y += test_distributor.c SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += test_distributor.c
SRCS-y += test_distributor_perf.c SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += test_distributor_perf.c
SRCS-y += test_devargs.c SRCS-y += test_devargs.c
SRCS-y += virtual_pmd.c SRCS-y += virtual_pmd.c
SRCS-y += packet_burst_generator.c SRCS-y += packet_burst_generator.c

View File

@ -36,8 +36,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_ACL
#include <rte_string_fns.h> #include <rte_string_fns.h>
#include <rte_mbuf.h> #include <rte_mbuf.h>
#include <rte_byteorder.h> #include <rte_byteorder.h>
@ -934,4 +932,3 @@ static struct test_command acl_cmd = {
.callback = test_acl, .callback = test_acl,
}; };
REGISTER_TEST_COMMAND(acl_cmd); REGISTER_TEST_COMMAND(acl_cmd);
#endif /* RTE_LIBRTE_ACL */

View File

@ -36,7 +36,6 @@
#include "test.h" #include "test.h"
#include "test_cmdline.h" #include "test_cmdline.h"
#ifdef RTE_LIBRTE_CMDLINE
static int static int
test_cmdline(void) test_cmdline(void)
{ {
@ -95,4 +94,3 @@ static struct test_command cmdline_cmd = {
.callback = test_cmdline, .callback = test_cmdline,
}; };
REGISTER_TEST_COMMAND(cmdline_cmd); REGISTER_TEST_COMMAND(cmdline_cmd);
#endif

View File

@ -33,7 +33,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_DISTRIBUTOR
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <rte_cycles.h> #include <rte_cycles.h>
@ -586,4 +585,3 @@ static struct test_command distributor_cmd = {
.callback = test_distributor, .callback = test_distributor,
}; };
REGISTER_TEST_COMMAND(distributor_cmd); REGISTER_TEST_COMMAND(distributor_cmd);
#endif

View File

@ -33,7 +33,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_DISTRIBUTOR
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <rte_cycles.h> #include <rte_cycles.h>
@ -266,4 +265,3 @@ static struct test_command distributor_perf_cmd = {
.callback = test_distributor_perf, .callback = test_distributor_perf,
}; };
REGISTER_TEST_COMMAND(distributor_perf_cmd); REGISTER_TEST_COMMAND(distributor_perf_cmd);
#endif

View File

@ -35,7 +35,6 @@
#include "test.h" #include "test.h"
#ifndef RTE_EXEC_ENV_BAREMETAL
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <libgen.h> #include <libgen.h>
@ -1288,4 +1287,3 @@ static struct test_command eal_flags_cmd = {
.callback = test_eal_flags, .callback = test_eal_flags,
}; };
REGISTER_TEST_COMMAND(eal_flags_cmd); REGISTER_TEST_COMMAND(eal_flags_cmd);
#endif

View File

@ -32,7 +32,6 @@
*/ */
#include "test.h" #include "test.h"
#ifndef RTE_EXEC_ENV_BAREMETAL
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -209,4 +208,3 @@ static struct test_command eal_fs_cmd = {
.callback = test_eal_fs, .callback = test_eal_fs,
}; };
REGISTER_TEST_COMMAND(eal_fs_cmd); REGISTER_TEST_COMMAND(eal_fs_cmd);
#endif

View File

@ -52,8 +52,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_HASH
#include <rte_hash.h> #include <rte_hash.h>
#include <rte_fbk_hash.h> #include <rte_fbk_hash.h>
#include <rte_jhash.h> #include <rte_jhash.h>
@ -1373,4 +1371,3 @@ static struct test_command hash_cmd = {
.callback = test_hash, .callback = test_hash,
}; };
REGISTER_TEST_COMMAND(hash_cmd); REGISTER_TEST_COMMAND(hash_cmd);
#endif /* RTE_LIBRTE_HASH */

View File

@ -53,8 +53,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_HASH
#include <rte_hash.h> #include <rte_hash.h>
#include <rte_fbk_hash.h> #include <rte_fbk_hash.h>
#include <rte_jhash.h> #include <rte_jhash.h>
@ -778,4 +776,3 @@ static struct test_command hash_perf_cmd = {
.callback = test_hash_perf, .callback = test_hash_perf,
}; };
REGISTER_TEST_COMMAND(hash_perf_cmd); REGISTER_TEST_COMMAND(hash_perf_cmd);
#endif /* RTE_LIBRTE_HASH */

View File

@ -43,8 +43,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_IVSHMEM
#include <rte_common.h> #include <rte_common.h>
#include <rte_ivshmem.h> #include <rte_ivshmem.h>
#include <rte_string_fns.h> #include <rte_string_fns.h>
@ -437,4 +435,3 @@ static struct test_command ivshmem_cmd = {
.callback = test_ivshmem, .callback = test_ivshmem,
}; };
REGISTER_TEST_COMMAND(ivshmem_cmd); REGISTER_TEST_COMMAND(ivshmem_cmd);
#endif /* RTE_LIBRTE_IVSHMEM */

View File

@ -39,7 +39,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_KNI
#include <rte_string_fns.h> #include <rte_string_fns.h>
#include <rte_mempool.h> #include <rte_mempool.h>
#include <rte_ethdev.h> #include <rte_ethdev.h>
@ -685,4 +684,3 @@ static struct test_command kni_cmd = {
.callback = test_kni, .callback = test_kni,
}; };
REGISTER_TEST_COMMAND(kni_cmd); REGISTER_TEST_COMMAND(kni_cmd);
#endif /* RTE_LIBRTE_KNI */

View File

@ -47,8 +47,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_LPM
#include "rte_lpm.h" #include "rte_lpm.h"
#include "test_lpm_routes.h" #include "test_lpm_routes.h"
@ -1354,4 +1352,3 @@ static struct test_command lpm_cmd = {
.callback = test_lpm, .callback = test_lpm,
}; };
REGISTER_TEST_COMMAND(lpm_cmd); REGISTER_TEST_COMMAND(lpm_cmd);
#endif /* RTE_LIBRTE_LPM */

View File

@ -41,8 +41,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_LPM
#include <rte_common.h> #include <rte_common.h>
#include <rte_cycles.h> #include <rte_cycles.h>
#include <rte_memory.h> #include <rte_memory.h>
@ -1925,4 +1923,3 @@ static struct test_command lpm6_cmd = {
.callback = test_lpm6, .callback = test_lpm6,
}; };
REGISTER_TEST_COMMAND(lpm6_cmd); REGISTER_TEST_COMMAND(lpm6_cmd);
#endif /* RTE_LIBRTE_LPM */

View File

@ -39,8 +39,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_METER
#include <rte_cycles.h> #include <rte_cycles.h>
#include <rte_meter.h> #include <rte_meter.h>
@ -501,4 +499,3 @@ static struct test_command meter_cmd = {
.callback = test_meter, .callback = test_meter,
}; };
REGISTER_TEST_COMMAND(meter_cmd); REGISTER_TEST_COMMAND(meter_cmd);
#endif /* RTE_LIBRTE_METER */

View File

@ -35,7 +35,6 @@
#include "test.h" #include "test.h"
#ifndef RTE_EXEC_ENV_BAREMETAL
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
@ -270,4 +269,3 @@ static struct test_command multiprocess_cmd = {
.callback = test_mp_secondary, .callback = test_mp_secondary,
}; };
REGISTER_TEST_COMMAND(multiprocess_cmd); REGISTER_TEST_COMMAND(multiprocess_cmd);
#endif

View File

@ -32,8 +32,6 @@
*/ */
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_PMD_RING
#include <stdio.h> #include <stdio.h>
#include <rte_eth_ring.h> #include <rte_eth_ring.h>
@ -450,5 +448,3 @@ static struct test_command ring_pmd_cmd = {
.callback = test_pmd_ring, .callback = test_pmd_ring,
}; };
REGISTER_TEST_COMMAND(ring_pmd_cmd); REGISTER_TEST_COMMAND(ring_pmd_cmd);
#endif

View File

@ -39,8 +39,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_POWER
#include <rte_power.h> #include <rte_power.h>
#define TEST_POWER_LCORE_ID 2U #define TEST_POWER_LCORE_ID 2U
@ -482,5 +480,3 @@ static struct test_command power_cmd = {
.callback = test_power, .callback = test_power,
}; };
REGISTER_TEST_COMMAND(power_cmd); REGISTER_TEST_COMMAND(power_cmd);
#endif /* RTE_LIBRTE_POWER */

View File

@ -43,8 +43,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_SCHED
#include <rte_red.h> #include <rte_red.h>
#ifdef __INTEL_COMPILER #ifdef __INTEL_COMPILER
@ -1889,4 +1887,3 @@ static struct test_command red_cmd = {
.callback = test_red, .callback = test_red,
}; };
REGISTER_TEST_COMMAND(red_cmd); REGISTER_TEST_COMMAND(red_cmd);
#endif

View File

@ -39,8 +39,6 @@
#include "test.h" #include "test.h"
#if defined(RTE_LIBRTE_SCHED) && defined(RTE_ARCH_X86_64)
#include <rte_cycles.h> #include <rte_cycles.h>
#include <rte_ether.h> #include <rte_ether.h>
#include <rte_ip.h> #include <rte_ip.h>
@ -234,4 +232,3 @@ static struct test_command sched_cmd = {
.callback = test_sched, .callback = test_sched,
}; };
REGISTER_TEST_COMMAND(sched_cmd); REGISTER_TEST_COMMAND(sched_cmd);
#endif /* RTE_LIBRTE_SCHED */

View File

@ -31,9 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef RTE_LIBRTE_TABLE
#include <rte_byteorder.h> #include <rte_byteorder.h>
#include <rte_hexdump.h> #include <rte_hexdump.h>
#include <rte_string_fns.h> #include <rte_string_fns.h>
@ -212,4 +209,3 @@ static struct test_command table_cmd = {
.callback = test_table, .callback = test_table,
}; };
REGISTER_TEST_COMMAND(table_cmd); REGISTER_TEST_COMMAND(table_cmd);
#endif

View File

@ -31,8 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef RTE_LIBRTE_ACL
#include <rte_hexdump.h> #include <rte_hexdump.h>
#include "test_table.h" #include "test_table.h"
#include "test_table_acl.h" #include "test_table_acl.h"
@ -587,5 +585,3 @@ test_table_ACL(void)
return 0; return 0;
} }
#endif

View File

@ -31,7 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef RTE_LIBRTE_TABLE
#include <string.h> #include <string.h>
#include "test_table_combined.h" #include "test_table_combined.h"
#include "test_table.h" #include "test_table.h"
@ -780,5 +779,3 @@ test_table_hash32ext(void)
return 0; return 0;
} }
#endif

View File

@ -31,12 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef RTE_LIBRTE_PIPELINE
#include "test.h"
#else
#include <string.h> #include <string.h>
#include <rte_pipeline.h> #include <rte_pipeline.h>
#include <rte_log.h> #include <rte_log.h>
@ -599,5 +593,3 @@ test_table_pipeline(void)
return 0; return 0;
} }
#endif

View File

@ -31,8 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef RTE_LIBRTE_TABLE
#include "test_table_ports.h" #include "test_table_ports.h"
#include "test_table.h" #include "test_table.h"
@ -220,5 +218,3 @@ test_port_ring_writer(void)
return 0; return 0;
} }
#endif

View File

@ -31,8 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef RTE_LIBRTE_TABLE
#include <string.h> #include <string.h>
#include <rte_byteorder.h> #include <rte_byteorder.h>
#include <rte_table_lpm_ipv6.h> #include <rte_table_lpm_ipv6.h>
@ -903,5 +901,3 @@ test_table_hash_ext(void)
return 0; return 0;
} }
#endif

View File

@ -33,7 +33,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_TIMER
/* /*
* Timer * Timer
* ===== * =====
@ -525,4 +524,3 @@ static struct test_command timer_cmd = {
.callback = test_timer, .callback = test_timer,
}; };
REGISTER_TEST_COMMAND(timer_cmd); REGISTER_TEST_COMMAND(timer_cmd);
#endif

View File

@ -33,7 +33,6 @@
#include "test.h" #include "test.h"
#ifdef RTE_LIBRTE_TIMER
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <inttypes.h> #include <inttypes.h>
@ -164,4 +163,3 @@ static struct test_command timer_perf_cmd = {
.callback = test_timer_perf, .callback = test_timer_perf,
}; };
REGISTER_TEST_COMMAND(timer_perf_cmd); REGISTER_TEST_COMMAND(timer_perf_cmd);
#endif