diff options
-rw-r--r-- | build-data/packages/vppinfra.mk | 5 | ||||
-rw-r--r-- | build-data/platforms/vpp.mk | 3 | ||||
-rw-r--r-- | vppinfra/Makefile.am | 6 | ||||
-rw-r--r-- | vppinfra/configure.ac | 7 |
4 files changed, 19 insertions, 2 deletions
diff --git a/build-data/packages/vppinfra.mk b/build-data/packages/vppinfra.mk index 92059877430..6ca6eb24b92 100644 --- a/build-data/packages/vppinfra.mk +++ b/build-data/packages/vppinfra.mk @@ -1,2 +1,5 @@ -# nothing + +ifeq ($($(PLATFORM)_enable_tests),yes) +vppinfra_configure_args += --enable-tests +endif diff --git a/build-data/platforms/vpp.mk b/build-data/platforms/vpp.mk index 9b4a78c89e7..c3c18aebc1c 100644 --- a/build-data/platforms/vpp.mk +++ b/build-data/platforms/vpp.mk @@ -17,6 +17,9 @@ vpp_native_tools = vppapigen vpp_uses_dpdk = yes +# Uncoment to enable building unit tests +# vpp_enable_tests = yes + vpp_root_packages = vpp vlib vlib-api vnet svm vpp-api-test \ vpp-japi gmod diff --git a/vppinfra/Makefile.am b/vppinfra/Makefile.am index 3a400163e52..adcd32cc868 100644 --- a/vppinfra/Makefile.am +++ b/vppinfra/Makefile.am @@ -20,7 +20,10 @@ endif lib_LIBRARIES = -TESTS = test_bihash_template \ +TESTS = + +if ENABLE_TESTS +TESTS += test_bihash_template \ test_elog \ test_elf \ test_fifo \ @@ -44,6 +47,7 @@ TESTS = test_bihash_template \ test_timing_wheel \ test_vec \ test_zvec +endif noinst_PROGRAMS = $(TESTS) check_PROGRAMS = $(TESTS) diff --git a/vppinfra/configure.ac b/vppinfra/configure.ac index d0b3a0c0dd2..712186af39d 100644 --- a/vppinfra/configure.ac +++ b/vppinfra/configure.ac @@ -31,6 +31,13 @@ AC_ARG_WITH(ldflags, ###################################################################### +AC_ARG_ENABLE(tests, + AC_HELP_STRING([--enable-tests],[Enable unit tests]), + [enable_tests=1], + [enable_tests=0]) + +AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" = "1") + AC_ARG_WITH(unix, AC_HELP_STRING([--with-unix],[Compile unix version of clib]), [], |