app/test: fix build without librte_cmdline

Some features are not available if LIBRTE_CMDLINE is disabled:
- interactive commands
- cmdline tests
Remove also cmdline_parse includes which are not needed.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
This commit is contained in:
Thomas Monjalon 2013-11-14 22:26:30 +01:00 committed by David Marchand
parent 645b0d13c9
commit 21a7f4e264
47 changed files with 19 additions and 93 deletions

View File

@ -39,7 +39,7 @@ APP = test
#
# all sources are stored in SRCS-y
#
SRCS-$(CONFIG_RTE_APP_TEST) := commands.c
SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := commands.c
SRCS-$(CONFIG_RTE_APP_TEST) += test.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_pci.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_prefetch.c
@ -78,13 +78,13 @@ SRCS-$(CONFIG_RTE_APP_TEST) += test_version.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_eal_fs.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_func_reentrancy.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_num.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_etheraddr.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_portlist.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_ipaddr.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_cirbuf.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_string.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_lib.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
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
SRCS-$(CONFIG_RTE_APP_TEST) += test_red.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_sched.c
SRCS-$(CONFIG_RTE_APP_TEST) += test_meter.c

View File

@ -41,10 +41,13 @@
#include <ctype.h>
#include <sys/queue.h>
#ifdef RTE_LIBRTE_CMDLINE
#include <cmdline_rdline.h>
#include <cmdline_parse.h>
#include <cmdline_socket.h>
#include <cmdline.h>
extern cmdline_parse_ctx_t main_ctx[];
#endif
#include <rte_memory.h>
#include <rte_memzone.h>
@ -109,7 +112,9 @@ do_recursive_call(void)
int
main(int argc, char **argv)
{
#ifdef RTE_LIBRTE_CMDLINE
struct cmdline *cl;
#endif
int ret;
ret = rte_eal_init(argc, argv);
@ -136,13 +141,14 @@ main(int argc, char **argv)
"HPET is not enabled, using TSC as default timer\n");
#ifdef RTE_LIBRTE_CMDLINE
cl = cmdline_stdin_new(main_ctx, "RTE>>");
if (cl == NULL) {
return -1;
}
cmdline_interact(cl);
cmdline_stdin_exit(cl);
#endif
return 0;
}

View File

@ -43,10 +43,6 @@
extern const char *prgname;
#include <cmdline_parse.h>
extern cmdline_parse_ctx_t main_ctx[];
int main(int argc, char **argv);
int test_pci(void);

View File

@ -34,8 +34,6 @@
#include <string.h>
#include <errno.h>
#include <cmdline_parse.h>
#include "test.h"
#ifdef RTE_LIBRTE_ACL

View File

@ -34,8 +34,6 @@
#include <stdio.h>
#include <stdint.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_interrupts.h>

View File

@ -36,8 +36,6 @@
#include <unistd.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_per_lcore.h>

View File

@ -36,8 +36,6 @@
#include <unistd.h>
#include <inttypes.h>
#include <cmdline_parse.h>
#include <rte_byteorder.h>
#include "test.h"

View File

@ -33,14 +33,13 @@
#include <stdio.h>
#include <cmdline_parse.h>
#include "test.h"
#include "test_cmdline.h"
int
test_cmdline(void)
{
#ifdef CONFIG_RTE_LIBRTE_CMDLINE
printf("Testind parsing ethernet addresses...\n");
if (test_parse_etheraddr_valid() < 0)
return -1;
@ -88,6 +87,9 @@ test_cmdline(void)
printf("Testing library functions...\n");
if (test_cmdline_lib() < 0)
return -1;
#else
printf("The cmdline library is not included in this build\n");
#endif
return 0;
}

View File

@ -36,8 +36,6 @@
#include <rte_common.h>
#include <rte_hexdump.h>
#include <cmdline_parse.h>
#include "test.h"
#define MAX_NUM 1 << 20

View File

@ -33,7 +33,6 @@
#include <stdio.h>
#include <cmdline_parse.h>
#include <errno.h>
#include <stdint.h>
#include <rte_cpuflags.h>

View File

@ -34,8 +34,6 @@
#include <stdio.h>
#include <stdint.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_cycles.h>

View File

@ -36,8 +36,6 @@
#include <sys/wait.h>
#include <unistd.h>
#include <cmdline_parse.h>
#include <rte_debug.h>
#include <rte_common.h>
#include <rte_eal.h>

View File

@ -32,8 +32,6 @@
*/
#include <stdio.h>
#include <cmdline_parse.h>
#include "test.h"
#ifndef RTE_EXEC_ENV_BAREMETAL

View File

@ -31,8 +31,6 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cmdline_parse.h>
#include "test.h"
#ifndef RTE_EXEC_ENV_BAREMETAL
#include <stdio.h>

View File

@ -40,8 +40,6 @@
#include <rte_errno.h>
#include <rte_string_fns.h>
#include <cmdline_parse.h>
#include "test.h"
int

View File

@ -70,8 +70,6 @@
#include <rte_string_fns.h>
#include <cmdline_parse.h>
#include "test.h"
typedef int (*case_func_t)(void* arg);

View File

@ -49,7 +49,6 @@
#include <rte_eal.h>
#include <rte_ip.h>
#include <rte_string_fns.h>
#include <cmdline_parse.h>
#include "test.h"

View File

@ -50,7 +50,6 @@
#include <rte_eal.h>
#include <rte_ip.h>
#include <rte_string_fns.h>
#include <cmdline_parse.h>
#include "test.h"

View File

@ -35,8 +35,6 @@
#include <stdint.h>
#include <unistd.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_cycles.h>
#include <rte_interrupts.h>

View File

@ -37,8 +37,6 @@
#include <string.h>
#include <sys/wait.h>
#include <cmdline_parse.h>
#include "test.h"
#ifdef RTE_LIBRTE_KNI

View File

@ -36,8 +36,6 @@
#include <stdarg.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_log.h>
#include <rte_memory.h>
#include <rte_memzone.h>

View File

@ -36,7 +36,6 @@
#include <stdlib.h>
#include <errno.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_cycles.h>

View File

@ -36,7 +36,6 @@
#include <string.h>
#include <errno.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <time.h>

View File

@ -39,8 +39,6 @@
#include <stdlib.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_memory.h>
#include <rte_memzone.h>

View File

@ -60,8 +60,6 @@
#include <rte_random.h>
#include <rte_cycles.h>
#include <cmdline_parse.h>
#include "test.h"
#define MBUF_SIZE 2048

View File

@ -37,7 +37,6 @@
#include <stdlib.h>
#include <rte_common.h>
#include <cmdline_parse.h>
#include <rte_cycles.h>
#include <rte_random.h>
#include <rte_malloc.h>

View File

@ -37,7 +37,6 @@
#include <stdlib.h>
#include <rte_common.h>
#include <cmdline_parse.h>
#include <rte_cycles.h>
#include <rte_random.h>
#include <rte_malloc.h>

View File

@ -34,8 +34,6 @@
#include <stdio.h>
#include <stdint.h>
#include <cmdline_parse.h>
#include <rte_memory.h>
#include <rte_common.h>

View File

@ -58,8 +58,6 @@
#include <rte_spinlock.h>
#include <rte_malloc.h>
#include <cmdline_parse.h>
#include "test.h"
/*

View File

@ -58,8 +58,6 @@
#include <rte_spinlock.h>
#include <rte_malloc.h>
#include <cmdline_parse.h>
#include "test.h"
/*

View File

@ -36,8 +36,6 @@
#include <inttypes.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_random.h>
#include <rte_cycles.h>
#include <rte_memory.h>

View File

@ -37,8 +37,6 @@
#include <stdint.h>
#include <unistd.h>
#include <cmdline_parse.h>
#include "test.h"
#ifdef RTE_LIBRTE_METER

View File

@ -33,8 +33,6 @@
#include <stdio.h>
#include <cmdline_parse.h>
#include "test.h"
#ifndef RTE_EXEC_ENV_BAREMETAL

View File

@ -36,8 +36,6 @@
#include <stdint.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_interrupts.h>
#include <rte_pci.h>

View File

@ -35,8 +35,6 @@
#include <stdint.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_memory.h>
#include <rte_memzone.h>

View File

@ -37,8 +37,6 @@
#include <limits.h>
#include <string.h>
#include <cmdline_parse.h>
#include "test.h"
#ifdef RTE_LIBRTE_POWER

View File

@ -34,8 +34,6 @@
#include <stdio.h>
#include <stdint.h>
#include <cmdline_parse.h>
#include <rte_prefetch.h>
#include "test.h"

View File

@ -40,7 +40,6 @@
#include <sys/time.h>
#include <time.h>
#include <math.h>
#include <cmdline_parse.h>
#include "test.h"

View File

@ -59,8 +59,6 @@
#include <rte_errno.h>
#include <rte_hexdump.h>
#include <cmdline_parse.h>
#include "test.h"
/*

View File

@ -38,8 +38,6 @@
#include <rte_cycles.h>
#include <rte_launch.h>
#include <cmdline_parse.h>
#include "test.h"
/*

View File

@ -36,8 +36,6 @@
#include <unistd.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_memory.h>
#include <rte_memzone.h>

View File

@ -37,8 +37,6 @@
#include <stdint.h>
#include <unistd.h>
#include <cmdline_parse.h>
#include "test.h"
#if defined(RTE_LIBRTE_SCHED) && defined(RTE_ARCH_X86_64)

View File

@ -38,8 +38,6 @@
#include <unistd.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_memory.h>
#include <rte_memzone.h>

View File

@ -39,8 +39,6 @@
#include <rte_string_fns.h>
#include <cmdline_parse.h>
#include "test.h"
#define LOG(...) do {\

View File

@ -37,8 +37,6 @@
#include <errno.h>
#include <sys/queue.h>
#include <cmdline_parse.h>
#include <rte_eal.h>
#include <rte_eal_memconfig.h>
#include <rte_string_fns.h>

View File

@ -124,8 +124,6 @@
#include <sys/queue.h>
#include <math.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_log.h>
#include <rte_memory.h>

View File

@ -35,8 +35,6 @@
#include <string.h>
#include <stdint.h>
#include <cmdline_parse.h>
#include <rte_common.h>
#include <rte_version.h>