From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by dpdk.org (Postfix) with ESMTP id 3904F36D for ; Mon, 18 Aug 2014 11:23:11 +0200 (CEST) Received: by mail-wi0-f182.google.com with SMTP id d1so3333860wiv.3 for ; Mon, 18 Aug 2014 02:26:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Vnxp5ArFJP3Trb2bkDLwI2EPZAlHQF8bEkPTkxcvbhk=; b=fBbpYYdIln/Xt11ncESHJ55KSJA7jpymtL3KZKqxSLPTBnxK9R0iZcSGNNnuDSj/vq g4UqVhl/paZrO7riy/22+oywEmDlv2Mk8Miycp/HrKbsK4HPvHiHOPXj+mR8SgGB/Nci 0uF+HwNxw8OUNDD/F6UKyyPvoXKqGoIFU9B3jDxM506+Cv+RZvuk7L5MIcaGJtM5B/Nn 6av/qP8Ug3hYoyJbuEC6gEsGGNUXL/QBUbr44bvMcB2VVqIxUF2vuBbQQz/8zgE3MfWs MLD027KVp7DHML5Z2Z57TxV4xHGu4mZO6f0/1HbJbNU0O8fdLPdq7dm/kLR2PONkVgOj 9H6w== X-Gm-Message-State: ALoCoQnHXNz5nljaqCbHQ4imBtf0V4RiSOUs/WbXTGkkjXts9lH9h0K6DhGw655Yojru1fBXC9JD X-Received: by 10.180.182.67 with SMTP id ec3mr40358359wic.21.1408353993584; Mon, 18 Aug 2014 02:26:33 -0700 (PDT) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id za9sm25087627wjc.29.2014.08.18.02.26.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Aug 2014 02:26:32 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Mon, 18 Aug 2014 11:26:13 +0200 Message-Id: <1408353973-16663-8-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1408353973-16663-1-git-send-email-david.marchand@6wind.com> References: <1408353973-16663-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH 7/7] app/test: only build what has been selected in config X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Aug 2014 09:23:11 -0000 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 --- app/test/Makefile | 61 ++++++++++++++++++++++++++------------ app/test/test_acl.c | 3 -- app/test/test_cmdline.c | 2 -- app/test/test_distributor.c | 2 -- app/test/test_distributor_perf.c | 2 -- app/test/test_eal_flags.c | 2 -- app/test/test_eal_fs.c | 2 -- app/test/test_hash.c | 3 -- app/test/test_hash_perf.c | 3 -- app/test/test_ivshmem.c | 3 -- app/test/test_kni.c | 2 -- app/test/test_lpm.c | 3 -- app/test/test_lpm6.c | 3 -- app/test/test_meter.c | 3 -- app/test/test_mp_secondary.c | 2 -- app/test/test_pmd_ring.c | 4 --- app/test/test_power.c | 4 --- app/test/test_red.c | 3 -- app/test/test_sched.c | 3 -- app/test/test_table.c | 4 --- app/test/test_table_acl.c | 4 --- app/test/test_table_combined.c | 3 -- app/test/test_table_pipeline.c | 8 ----- app/test/test_table_ports.c | 4 --- app/test/test_table_tables.c | 4 --- app/test/test_timer.c | 2 -- app/test/test_timer_perf.c | 2 -- 27 files changed, 42 insertions(+), 99 deletions(-) diff --git a/app/test/Makefile b/app/test/Makefile index abb7426..4797382 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -53,39 +53,57 @@ SRCS-y += test_cycles.c SRCS-y += test_spinlock.c SRCS-y += test_memory.c SRCS-y += test_memzone.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_pipeline.c +SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) += test_table_pipeline.c SRCS-y += test_table_tables.c SRCS-y += test_table_ports.c SRCS-y += test_table_combined.c -SRCS-y += test_table_acl.c -SRCS-y += test_ring_perf.c +SRCS-$(CONFIG_RTE_LIBRTE_ACL) += test_table_acl.c +endif + 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_perf.c + SRCS-y += test_mbuf.c SRCS-y += test_logs.c + SRCS-y += test_memcpy.c SRCS-y += test_memcpy_perf.c -SRCS-y += test_hash.c -SRCS-y += test_hash_perf.c -SRCS-y += test_lpm.c -SRCS-y += test_lpm6.c + +SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash.c +SRCS-$(CONFIG_RTE_LIBRTE_HASH) += test_hash_perf.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_errno.c SRCS-y += test_tailq.c SRCS-y += test_string_fns.c -SRCS-y += test_mp_secondary.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_fs.c +endif + SRCS-y += test_alarm.c SRCS-y += test_interrupts.c SRCS-y += test_version.c -SRCS-y += test_eal_fs.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_etheraddr.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_string.c SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c + +ifeq ($(CONFIG_RTE_LIBRTE_SCHED),y) SRCS-y += test_red.c -SRCS-y += test_sched.c -SRCS-y += test_meter.c -SRCS-y += test_kni.c -SRCS-y += test_power.c +SRCS-$(CONFIG_RTE_ARCH_X86_64) += test_sched.c +endif + +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_timer_perf.c -SRCS-y += test_ivshmem.c -SRCS-y += test_distributor.c -SRCS-y += test_distributor_perf.c +SRCS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += test_ivshmem.c + +SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += test_distributor.c +SRCS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += test_distributor_perf.c + SRCS-y += test_devargs.c SRCS-y += virtual_pmd.c SRCS-y += packet_burst_generator.c diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 4e7b470..c6b3f86 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -36,8 +36,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_ACL - #include #include #include @@ -934,4 +932,3 @@ static struct test_command acl_cmd = { .callback = test_acl, }; REGISTER_TEST_COMMAND(acl_cmd); -#endif /* RTE_LIBRTE_ACL */ diff --git a/app/test/test_cmdline.c b/app/test/test_cmdline.c index 9b8bd5c..2b5840f 100644 --- a/app/test/test_cmdline.c +++ b/app/test/test_cmdline.c @@ -36,7 +36,6 @@ #include "test.h" #include "test_cmdline.h" -#ifdef RTE_LIBRTE_CMDLINE static int test_cmdline(void) { @@ -95,4 +94,3 @@ static struct test_command cmdline_cmd = { .callback = test_cmdline, }; REGISTER_TEST_COMMAND(cmdline_cmd); -#endif diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c index b29bef8..eca974d 100644 --- a/app/test/test_distributor.c +++ b/app/test/test_distributor.c @@ -33,7 +33,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_DISTRIBUTOR #include #include #include @@ -586,4 +585,3 @@ static struct test_command distributor_cmd = { .callback = test_distributor, }; REGISTER_TEST_COMMAND(distributor_cmd); -#endif diff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c index 8a6b855..849387d 100644 --- a/app/test/test_distributor_perf.c +++ b/app/test/test_distributor_perf.c @@ -33,7 +33,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_DISTRIBUTOR #include #include #include @@ -266,4 +265,3 @@ static struct test_command distributor_perf_cmd = { .callback = test_distributor_perf, }; REGISTER_TEST_COMMAND(distributor_perf_cmd); -#endif diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 2d81764..21e6cca 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -35,7 +35,6 @@ #include "test.h" -#ifndef RTE_EXEC_ENV_BAREMETAL #include #include #include @@ -1288,4 +1287,3 @@ static struct test_command eal_flags_cmd = { .callback = test_eal_flags, }; REGISTER_TEST_COMMAND(eal_flags_cmd); -#endif diff --git a/app/test/test_eal_fs.c b/app/test/test_eal_fs.c index 8d4edc1..cd41b3e 100644 --- a/app/test/test_eal_fs.c +++ b/app/test/test_eal_fs.c @@ -32,7 +32,6 @@ */ #include "test.h" -#ifndef RTE_EXEC_ENV_BAREMETAL #include #include #include @@ -209,4 +208,3 @@ static struct test_command eal_fs_cmd = { .callback = test_eal_fs, }; REGISTER_TEST_COMMAND(eal_fs_cmd); -#endif diff --git a/app/test/test_hash.c b/app/test/test_hash.c index ae3238b..178ec3f 100644 --- a/app/test/test_hash.c +++ b/app/test/test_hash.c @@ -52,8 +52,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_HASH - #include #include #include @@ -1373,4 +1371,3 @@ static struct test_command hash_cmd = { .callback = test_hash, }; REGISTER_TEST_COMMAND(hash_cmd); -#endif /* RTE_LIBRTE_HASH */ diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index d3e9990..7bb7016 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -53,8 +53,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_HASH - #include #include #include @@ -778,4 +776,3 @@ static struct test_command hash_perf_cmd = { .callback = test_hash_perf, }; REGISTER_TEST_COMMAND(hash_perf_cmd); -#endif /* RTE_LIBRTE_HASH */ diff --git a/app/test/test_ivshmem.c b/app/test/test_ivshmem.c index e759939..2996a86 100644 --- a/app/test/test_ivshmem.c +++ b/app/test/test_ivshmem.c @@ -43,8 +43,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_IVSHMEM - #include #include #include @@ -437,4 +435,3 @@ static struct test_command ivshmem_cmd = { .callback = test_ivshmem, }; REGISTER_TEST_COMMAND(ivshmem_cmd); -#endif /* RTE_LIBRTE_IVSHMEM */ diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 60683d2..2860bf3 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -39,7 +39,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_KNI #include #include #include @@ -685,4 +684,3 @@ static struct test_command kni_cmd = { .callback = test_kni, }; REGISTER_TEST_COMMAND(kni_cmd); -#endif /* RTE_LIBRTE_KNI */ diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index 087d97a..6d8823e 100644 --- a/app/test/test_lpm.c +++ b/app/test/test_lpm.c @@ -47,8 +47,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_LPM - #include "rte_lpm.h" #include "test_lpm_routes.h" @@ -1354,4 +1352,3 @@ static struct test_command lpm_cmd = { .callback = test_lpm, }; REGISTER_TEST_COMMAND(lpm_cmd); -#endif /* RTE_LIBRTE_LPM */ diff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c index bd99125..1f88d7a 100644 --- a/app/test/test_lpm6.c +++ b/app/test/test_lpm6.c @@ -41,8 +41,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_LPM - #include #include #include @@ -1925,4 +1923,3 @@ static struct test_command lpm6_cmd = { .callback = test_lpm6, }; REGISTER_TEST_COMMAND(lpm6_cmd); -#endif /* RTE_LIBRTE_LPM */ diff --git a/app/test/test_meter.c b/app/test/test_meter.c index 215cbf8..bc76391 100644 --- a/app/test/test_meter.c +++ b/app/test/test_meter.c @@ -39,8 +39,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_METER - #include #include @@ -501,4 +499,3 @@ static struct test_command meter_cmd = { .callback = test_meter, }; REGISTER_TEST_COMMAND(meter_cmd); -#endif /* RTE_LIBRTE_METER */ diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c index 7579e20..95a12e2 100644 --- a/app/test/test_mp_secondary.c +++ b/app/test/test_mp_secondary.c @@ -35,7 +35,6 @@ #include "test.h" -#ifndef RTE_EXEC_ENV_BAREMETAL #include #include #include @@ -270,4 +269,3 @@ static struct test_command multiprocess_cmd = { .callback = test_mp_secondary, }; REGISTER_TEST_COMMAND(multiprocess_cmd); -#endif diff --git a/app/test/test_pmd_ring.c b/app/test/test_pmd_ring.c index 6364495..7490112 100644 --- a/app/test/test_pmd_ring.c +++ b/app/test/test_pmd_ring.c @@ -32,8 +32,6 @@ */ #include "test.h" -#ifdef RTE_LIBRTE_PMD_RING - #include #include @@ -450,5 +448,3 @@ static struct test_command ring_pmd_cmd = { .callback = test_pmd_ring, }; REGISTER_TEST_COMMAND(ring_pmd_cmd); -#endif - diff --git a/app/test/test_power.c b/app/test/test_power.c index 123b199..d9eb420 100644 --- a/app/test/test_power.c +++ b/app/test/test_power.c @@ -39,8 +39,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_POWER - #include #define TEST_POWER_LCORE_ID 2U @@ -482,5 +480,3 @@ static struct test_command power_cmd = { .callback = test_power, }; REGISTER_TEST_COMMAND(power_cmd); -#endif /* RTE_LIBRTE_POWER */ - diff --git a/app/test/test_red.c b/app/test/test_red.c index 7cf2221..262df72 100644 --- a/app/test/test_red.c +++ b/app/test/test_red.c @@ -43,8 +43,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_SCHED - #include #ifdef __INTEL_COMPILER @@ -1889,4 +1887,3 @@ static struct test_command red_cmd = { .callback = test_red, }; REGISTER_TEST_COMMAND(red_cmd); -#endif diff --git a/app/test/test_sched.c b/app/test/test_sched.c index 2cc9df5..ce47084 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -39,8 +39,6 @@ #include "test.h" -#if defined(RTE_LIBRTE_SCHED) && defined(RTE_ARCH_X86_64) - #include #include #include @@ -234,4 +232,3 @@ static struct test_command sched_cmd = { .callback = test_sched, }; REGISTER_TEST_COMMAND(sched_cmd); -#endif /* RTE_LIBRTE_SCHED */ diff --git a/app/test/test_table.c b/app/test/test_table.c index 33e2efc..c3093cc 100644 --- a/app/test/test_table.c +++ b/app/test/test_table.c @@ -31,9 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -#ifdef RTE_LIBRTE_TABLE - #include #include #include @@ -212,4 +209,3 @@ static struct test_command table_cmd = { .callback = test_table, }; REGISTER_TEST_COMMAND(table_cmd); -#endif diff --git a/app/test/test_table_acl.c b/app/test/test_table_acl.c index 5bcc8b8..dda0570 100644 --- a/app/test/test_table_acl.c +++ b/app/test/test_table_acl.c @@ -31,8 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef RTE_LIBRTE_ACL - #include #include "test_table.h" #include "test_table_acl.h" @@ -587,5 +585,3 @@ test_table_ACL(void) return 0; } - -#endif diff --git a/app/test/test_table_combined.c b/app/test/test_table_combined.c index 3380ff1..dd09da5 100644 --- a/app/test/test_table_combined.c +++ b/app/test/test_table_combined.c @@ -31,7 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef RTE_LIBRTE_TABLE #include #include "test_table_combined.h" #include "test_table.h" @@ -780,5 +779,3 @@ test_table_hash32ext(void) return 0; } - -#endif diff --git a/app/test/test_table_pipeline.c b/app/test/test_table_pipeline.c index 35644a6..70b1015 100644 --- a/app/test/test_table_pipeline.c +++ b/app/test/test_table_pipeline.c @@ -31,12 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef RTE_LIBRTE_PIPELINE - -#include "test.h" - -#else - #include #include #include @@ -599,5 +593,3 @@ test_table_pipeline(void) return 0; } - -#endif diff --git a/app/test/test_table_ports.c b/app/test/test_table_ports.c index e9d45b0..2532367 100644 --- a/app/test/test_table_ports.c +++ b/app/test/test_table_ports.c @@ -31,8 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef RTE_LIBRTE_TABLE - #include "test_table_ports.h" #include "test_table.h" @@ -220,5 +218,3 @@ test_port_ring_writer(void) return 0; } - -#endif diff --git a/app/test/test_table_tables.c b/app/test/test_table_tables.c index da8338c..14add77 100644 --- a/app/test/test_table_tables.c +++ b/app/test/test_table_tables.c @@ -31,8 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifdef RTE_LIBRTE_TABLE - #include #include #include @@ -903,5 +901,3 @@ test_table_hash_ext(void) return 0; } - -#endif diff --git a/app/test/test_timer.c b/app/test/test_timer.c index ec826c0..4b4800b 100644 --- a/app/test/test_timer.c +++ b/app/test/test_timer.c @@ -33,7 +33,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_TIMER /* * Timer * ===== @@ -525,4 +524,3 @@ static struct test_command timer_cmd = { .callback = test_timer, }; REGISTER_TEST_COMMAND(timer_cmd); -#endif diff --git a/app/test/test_timer_perf.c b/app/test/test_timer_perf.c index da92473..3f7ddd3 100644 --- a/app/test/test_timer_perf.c +++ b/app/test/test_timer_perf.c @@ -33,7 +33,6 @@ #include "test.h" -#ifdef RTE_LIBRTE_TIMER #include #include #include @@ -164,4 +163,3 @@ static struct test_command timer_perf_cmd = { .callback = test_timer_perf, }; REGISTER_TEST_COMMAND(timer_perf_cmd); -#endif -- 1.7.10.4